34
34
[ac_cv_warnings_as_errors=yes],
35
35
[ac_cv_warnings_as_errors=no]))
37
AC_ARG_ENABLE([gcc-profile-mode],
38
[AS_HELP_STRING([--enable-gcc-profile-mode],
39
[Toggle gcc profile mode @<:@default=off@:>@])],
40
[ac_gcc_profile_mode="$enableval"],
41
[ac_gcc_profile_mode="no"])
43
37
AC_ARG_ENABLE([profiling],
44
38
[AS_HELP_STRING([--enable-profiling],
45
39
[Toggle profiling @<:@default=off@:>@])],
93
87
F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
96
AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
97
[ac_cv_safe_to_use_floop_parallelize_all_],
98
[save_CFLAGS="$CFLAGS"
99
CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
101
[AC_LANG_PROGRAM([],[])],
102
[ac_cv_safe_to_use_floop_parallelize_all_=yes],
103
[ac_cv_safe_to_use_floop_parallelize_all_=no])
104
CFLAGS="$save_CFLAGS"])
106
AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
108
F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
90
AC_CACHE_CHECK([whether it is safe to use -Wformat],
91
[ac_cv_safe_to_use_wformat_],
92
[save_CFLAGS="$CFLAGS"
93
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
94
dnl conversion warnings to all the tarball folks
95
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
100
#include <inttypes.h>
104
printf("This is a %" PRIu64 "test\n", test_u);
109
[ac_cv_safe_to_use_wformat_=yes],
110
[ac_cv_safe_to_use_wformat_=no])
111
CFLAGS="$save_CFLAGS"])
112
AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
114
W_FORMAT_2="-Wformat=2"
115
NO_FORMAT="-Wno-format"
117
W_FORMAT="-Wno-format"
118
W_FORMAT_2="-Wno-format"
119
NO_FORMAT="-Wno-format"
124
AC_CACHE_CHECK([whether it is safe to use -Wconversion],
125
[ac_cv_safe_to_use_wconversion_],
126
[save_CFLAGS="$CFLAGS"
127
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
128
dnl conversion warnings to all the tarball folks
129
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
140
[ac_cv_safe_to_use_wconversion_=yes],
141
[ac_cv_safe_to_use_wconversion_=no])
142
CFLAGS="$save_CFLAGS"])
144
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
145
[W_CONVERSION="-Wconversion"
146
AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
147
[ac_cv_safe_to_use_Wconversion_],
148
[save_CFLAGS="$CFLAGS"
149
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
150
dnl conversion warnings to all the tarball folks
151
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
155
#include <netinet/in.h>
157
uint16_t x= htons(80);
159
[ac_cv_safe_to_use_Wconversion_=yes],
160
[ac_cv_safe_to_use_Wconversion_=no])
161
CFLAGS="$save_CFLAGS"])
163
AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
164
[NO_CONVERSION="-Wno-conversion"])
111
167
NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
112
168
NO_SHADOW="-Wno-shadow"
114
170
AS_IF([test "$INTELCC" = "yes"],[
115
171
m4_if(PW_LESS_WARNINGS,[no],[
116
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
172
BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
118
174
dnl 2203 is like old-style-cast
119
175
dnl 1684 is like strict-aliasing
120
176
dnl 188 is about using enums as bitfields
121
177
dnl 1683 is a warning about _EXPLICIT_ casting, which we want
122
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
178
BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
124
180
CC_WARNINGS="${BASE_WARNINGS}"
125
181
CXX_WARNINGS="${BASE_WARNINGS}"
129
185
m4_if(PW_LESS_WARNINGS,[no],[
130
BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing"
186
BASE_WARNINGS_FULL="${W_FORMAT_2} ${W_CONVERSION} -Wstrict-aliasing"
131
187
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
132
188
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
133
189
NO_OLD_STYLE_CAST="-Wno-old-style-cast"
134
190
NO_EFF_CXX="-Wno-effc++"
136
BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
192
BASE_WARNINGS_FULL="${W_FORMAT_2} ${NO_STRICT_ALIASING}"
139
195
AS_IF([test "${ac_cv_assert}" = "no"],
153
209
[ac_cv_safe_to_use_Wextra_=no])
154
210
CFLAGS="$save_CFLAGS"])
156
BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
212
BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${BASE_WARNINGS_FULL}"
157
213
AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
158
214
[BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
159
215
[BASE_WARNINGS="${BASE_WARNINGS} -W"])
161
AC_CACHE_CHECK([whether it is safe to use -Wformat],
162
[ac_cv_safe_to_use_wformat_],
163
[save_CFLAGS="$CFLAGS"
164
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
165
dnl conversion warnings to all the tarball folks
166
CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
171
#include <inttypes.h>
176
printf("This is a %" PRIu64 "test\n", test_u);
181
[ac_cv_safe_to_use_wformat_=yes],
182
[ac_cv_safe_to_use_wformat_=no])
183
CFLAGS="$save_CFLAGS"])
184
AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
185
BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wno-format-security"
186
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wno-format-security"
188
BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
189
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
194
AC_CACHE_CHECK([whether it is safe to use -Wconversion],
195
[ac_cv_safe_to_use_wconversion_],
196
[save_CFLAGS="$CFLAGS"
197
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
198
dnl conversion warnings to all the tarball folks
199
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
210
[ac_cv_safe_to_use_wconversion_=yes],
211
[ac_cv_safe_to_use_wconversion_=no])
212
CFLAGS="$save_CFLAGS"])
214
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
215
[W_CONVERSION="-Wconversion"
216
AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
217
[ac_cv_safe_to_use_Wconversion_],
218
[save_CFLAGS="$CFLAGS"
219
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
220
dnl conversion warnings to all the tarball folks
221
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
225
#include <netinet/in.h>
227
uint16_t x= htons(80);
229
[ac_cv_safe_to_use_Wconversion_=yes],
230
[ac_cv_safe_to_use_Wconversion_=no])
231
CFLAGS="$save_CFLAGS"])
233
AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
234
[NO_CONVERSION="-Wno-conversion"])
237
217
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
238
218
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
256
236
AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
257
237
[CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
259
AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
260
[ac_cv_safe_to_use_Wframe_larger_than_],
262
save_CXXFLAGS="$CXXFLAGS"
263
CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
270
[ac_cv_safe_to_use_Wframe_larger_than_=yes],
271
[ac_cv_safe_to_use_Wframe_larger_than_=no])
272
CXXFLAGS="$save_CXXFLAGS"
275
AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
276
[CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
278
239
AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
279
240
[ac_cv_safe_to_use_Wlogical_op_],
280
241
[save_CFLAGS="$CFLAGS"
408
368
m4_if(PW_LESS_WARNINGS, [no],[
409
CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
369
CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
410
370
CXX_WARNINGS_FULL="-erroff=inllargeuse"
412
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
372
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
413
373
CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
417
377
CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
418
378
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
419
379
BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
420
PERMISSIVE_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem,notused,badargtype2w,wunreachable"
421
INNOBASE_SKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit,wunreachable"
422
380
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
423
381
NO_WERROR="-errwarn=%none"