Psi4
pragma.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
30 
31 #ifndef PULSAR_GUARD_PULSAR__PRAGMA_H_
32 #define PULSAR_GUARD_PULSAR__PRAGMA_H_
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 
40 #if defined(__ICC) || defined(__INTEL_COMPILER)
41 
42  // pragmas for Intel
43  #define PRAGMA_WARNING_POP _Pragma("warning(pop)")
44  #define PRAGMA_WARNING_PUSH _Pragma("warning(push)")
45  #define PRAGMA_WARNING_IGNORE_UNUSED_PARAMETERS _Pragma("warning(disable:869)")
46  #define PRAGMA_WARNING_IGNORE_UNUSED_VARIABLES _Pragma("warning(disable:177)")
47  #define PRAGMA_WARNING_IGNORE_FP_EQUALITY _Pragma("warning(disable:1572)")
48  #define PRAGMA_WARNING_IGNORE_FP_CONVERT _Pragma("warning(disable:264 173)")
49  #define PRAGMA_WARNING_IGNORE_CONVERT _Pragma("warning(disable:2259)")
50  #define PRAGMA_WARNING_IGNORE_SWITCH_MISSING_DEFAULT _Pragma("warning(disable:2338)")
51  #define PRAGMA_WARNING_IGNORE_POINTLESS_COMPARISON_UINT_0 _Pragma("warning(disable:186)")
52  #define PRAGMA_WARNING_IGNORE_STATEMENT_UNREACHABLE _Pragma("warning(disable:111)")
53  #define PRAGMA_WARNING_IGNORE_SHADOW _Pragma("warning(disable:1599)")
54  #define PRAGMA_WARNING_IGNORE_SHADOW_MEMBER _Pragma("warning(disable:3280)")
55  #define PRAGMA_WARNING_IGNORE_EXTRA_SEMICOLON // does not have warning for intel
56  #define PRAGMA_WARNING_IGNORE_REDECLARED_INLINE _Pragma("warning(disable:522)")
57  #define PRAGMA_WARNING_IGNORE_UNUSED_LOCAL_TYPEDEFS
58  #define PRAGMA_WARNING_IGNORE_GCC_PRAGMA _Pragma("warning(disable:2282)")
59  #define PRAGMA_WARNING_IGNORE_NONVIRTUAL_DTOR _Pragma("warning(disable:444)")
60  #define PRAGMA_WARNING_IGNORE_UNUSED_FUNCTION
61  #define PRAGMA_WARNING_IGNORE_UNRECOGNIZED_PRAGMA _Pragma("warning(disable:161)")
62  #define PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS _Pragma("warning(disable:1478)")
63 
64 #elif defined(__GNUC__) || defined(__GNUG__)
65 
66  // pragmas for GCC
67  #define PRAGMA_WARNING_PUSH _Pragma("GCC diagnostic push")
68  #define PRAGMA_WARNING_POP _Pragma("GCC diagnostic pop")
69  #define PRAGMA_WARNING_IGNORE_UNUSED_PARAMETERS _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
70  #define PRAGMA_WARNING_IGNORE_UNUSED_VARIABLES _Pragma("GCC diagnostic ignored \"-Wunused-variable\"")
71  #define PRAGMA_WARNING_IGNORE_FP_EQUALITY _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"")
72  #define PRAGMA_WARNING_IGNORE_FP_CONVERT _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"")
73  #define PRAGMA_WARNING_IGNORE_CONVERT _Pragma("GCC diagnostic ignored \"-Wconversion\"")
74  #define PRAGMA_WARNING_IGNORE_SWITCH_MISSING_DEFAULT _Pragma("GCC diagnostic ignored \"-Wswitch-default\"")
75  #define PRAGMA_WARNING_IGNORE_POINTLESS_COMPARISON_UINT_0 _Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
76  #define PRAGMA_WARNING_IGNORE_STATEMENT_UNREACHABLE
77  #define PRAGMA_WARNING_IGNORE_SHADOW _Pragma("GCC diagnostic ignored \"-Wshadow\"")
78  #define PRAGMA_WARNING_IGNORE_SHADOW_MEMBER
79  #define PRAGMA_WARNING_IGNORE_EXTRA_SEMICOLON _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
80  #define PRAGMA_WARNING_IGNORE_REDECLARED_INLINE // does not have warning for GCC
81  #define PRAGMA_WARNING_IGNORE_UNUSED_LOCAL_TYPEDEFS _Pragma("GCC diagnostic ignored \"-Wunused-local-typedefs\"")
82  #define PRAGMA_WARNING_IGNORE_GCC_PRAGMA // uh... not a warning in gcc
83  #define PRAGMA_WARNING_IGNORE_NONVIRTUAL_DTOR // Doesn't seem to warn in GCC
84  #define PRAGMA_WARNING_IGNORE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
85  #define PRAGMA_WARNING_IGNORE_UNRECOGNIZED_PRAGMA _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
86  #define PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
87 #endif
88 
89 
90 
91 
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif