MolSSI Integral Reference Project
pragma.h
Go to the documentation of this file.
1 /*! \file
2  *
3  * \brief Pragmas for enabling/disabling compiler warnings
4  */
5 
6 #pragma once
7 
8 
9 #if defined(__ICC) || defined(__INTEL_COMPILER)
10 
11  /* pragmas for Intel */
12  #define PRAGMA_WARNING_POP _Pragma("warning(pop)")
13  #define PRAGMA_WARNING_PUSH _Pragma("warning(push)")
14  #define PRAGMA_WARNING_IGNORE_FP_UNDERFLOW _Pragma("warning(disable:239)")
15  #define PRAGMA_WARNING_IGNORE_FP_EQUALITY _Pragma("warning(disable:1572)")
16  //#define PRAGMA_WARNING_IGNORE_SIGN_CONVERSION // todo
17 
18 #elif defined(__clang__)
19 
20  /* pragmas for Clang.
21  * Do this before GCC because clang also defines __GNUC__
22  */
23  #define PRAGMA_WARNING_PUSH _Pragma("clang diagnostic push")
24  #define PRAGMA_WARNING_POP _Pragma("clang diagnostic pop")
25  #define PRAGMA_WARNING_IGNORE_FP_UNDERFLOW // Does not exist for clang?
26  #define PRAGMA_WARNING_IGNORE_FP_EQUALITY _Pragma("clang diagnostic ignored \"-Wfloat-equal\"")
27  //#define PRAGMA_WARNING_IGNORE_SIGN_CONVERSION _Pragma("clang diagnostic ignored \"-Wsign-conversion\"")
28 
29 #elif defined(__GNUC__) || defined(__GNUG__)
30 
31  /* pragmas for GCC */
32  #define PRAGMA_WARNING_PUSH _Pragma("GCC diagnostic push")
33  #define PRAGMA_WARNING_POP _Pragma("GCC diagnostic pop")
34  #define PRAGMA_WARNING_IGNORE_FP_UNDERFLOW // Does not exist for gcc?
35  #define PRAGMA_WARNING_IGNORE_FP_EQUALITY _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"")
36  //#define PRAGMA_WARNING_IGNORE_SIGN_CONVERSION _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"")
37 
38 
39 #endif