libMesh
ignore_warnings.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 // Note: no include guards! We want to be able to #include this
20 // header multiple times.
21 
22 #include "libmesh/libmesh_config.h"
23 
24 // TODO: icpc options
25 #ifdef __clang__
26 #pragma clang diagnostic push
27 // The first four should remain here to avoid warnings about warnings
28 #pragma clang diagnostic ignored "-Wunknown-pragmas"
29 #pragma clang diagnostic ignored "-Wpragmas"
30 #pragma clang diagnostic ignored "-Wunknown-warning-option"
31 #pragma clang diagnostic ignored "-Wunknown-warning"
32 #pragma clang diagnostic ignored "-Wunused-parameter"
33 #pragma clang diagnostic ignored "-Wextra-semi"
34 #pragma clang diagnostic ignored "-Wvariadic-macros"
35 #pragma clang diagnostic ignored "-Wc++11-extensions"
36 #pragma clang diagnostic ignored "-Wnested-anon-types"
37 #pragma clang diagnostic ignored "-Wsign-compare"
38 #pragma clang diagnostic ignored "-Wunused-private-field"
39 #pragma clang diagnostic ignored "-Wextra"
40 #pragma clang diagnostic ignored "-Wredundant-decls"
41 #pragma clang diagnostic ignored "-Wcast-align"
42 #pragma clang diagnostic ignored "-Wcast-qual"
43 #pragma clang diagnostic ignored "-Wswitch-default"
44 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
45 #pragma clang diagnostic ignored "-Woverloaded-virtual"
46 #pragma clang diagnostic ignored "-Wmacro-redefined"
47 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
48 #pragma clang diagnostic ignored "-Wunused-but-set-variable"
49 #pragma clang diagnostic ignored "-Winvalid-utf8"
50 // Ignore warnings from code that does "if (foo) bar();"
51 #pragma clang diagnostic ignored "-Wmisleading-indentation"
52 #pragma clang diagnostic ignored "-Wint-in-bool-context"
53 #pragma clang diagnostic ignored "-Wdeprecated-copy"
54 #endif
55 
56 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
57 // GCC > 4.5 supports diagnostic pragmas with push/pop
58 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
59 #pragma GCC diagnostic push
60 // The first four should remain here to avoid warnings about warnings
61 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
62 #pragma GCC diagnostic ignored "-Wpragmas"
63 #pragma GCC diagnostic ignored "-Wunknown-warning-option"
64 #pragma GCC diagnostic ignored "-Wunknown-warning"
65 #pragma GCC diagnostic ignored "-Wunused-parameter"
66 // These two don't work?
67 #pragma GCC diagnostic ignored "-Wpedantic"
68 #pragma GCC diagnostic ignored "-Wdeprecated"
69 // But this is helpful with some MPI stacks
70 #pragma GCC diagnostic ignored "-Wunused-parameter"
71 // And these are for cppunit
72 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
73 #pragma GCC diagnostic ignored "-Wundef"
74 // And these are for Trilinos
75 #pragma GCC diagnostic ignored "-Wextra"
76 #pragma GCC diagnostic ignored "-Wshadow"
77 // And these are for PETSc
78 #pragma GCC diagnostic ignored "-Wredundant-decls"
79 #pragma GCC diagnostic ignored "-Wcast-qual"
80 #pragma GCC diagnostic ignored "-Wswitch-default"
81 // And these are for Eigen
82 #pragma GCC diagnostic ignored "-Wconversion"
83 #pragma GCC diagnostic ignored "-Wstack-protector"
84 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
85 // And this for VTK
86 #pragma GCC diagnostic ignored "-Wlogical-op"
87 // Ignore warnings from code that uses deprecated members of std, like std::auto_ptr.
88 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
89 // This is mostly for the (deprecated...) C++ MPI wrappers
90 #pragma GCC diagnostic ignored "-Wsuggest-override"
91 // Ignore this for VTK
92 #pragma GCC diagnostic ignored "-Wfloat-conversion"
93 // Ignore warnings from code that does "if (foo) bar();"
94 #pragma GCC diagnostic ignored "-Wmisleading-indentation"
95 // Ignore warnings from bad placement new use
96 #pragma GCC diagnostic ignored "-Wplacement-new"
97 #pragma GCC diagnostic ignored "-Wint-in-bool-context"
98 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
99 #pragma GCC diagnostic ignored "-Wparentheses"
100 #pragma GCC diagnostic ignored "-Wcast-function-type"
101 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
102 #pragma GCC diagnostic ignored "-Wclass-memaccess"
103 #endif
104 #endif // __GNUC__ && !__INTEL_COMPILER
105 
106 #ifdef __NVCOMPILER
107 # pragma nv_diagnostic push
108 // Warning numbers are from --display_error_number
109 # ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
110 # pragma nv_diag_suppress 11 // unrecognized preprocessing directive
111 # pragma nv_diag_suppress 177 // declared but never referenced
112 # pragma nv_diag_suppress 541 // allowing all exceptions is incompatible with previous function
113 # pragma nv_diag_suppress 1758 // conversion between incompatible vector types
114 # pragma nv_diag_suppress = integer_sign_change
115 # else
116 # pragma diag_suppress 11
117 # pragma diag_suppress 177
118 # pragma diag_suppress 541
119 # pragma diag_suppress 1758
120 # pragma diag_suppress = integer_sign_change
121 # endif
122 #endif