93
81
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_],
84
AC_CACHE_CHECK([whether it is safe to use -Wconversion],
85
[ac_cv_safe_to_use_wconversion_],
98
86
[save_CFLAGS="$CFLAGS"
99
CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
87
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
88
dnl conversion warnings to all the tarball folks
89
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
100
90
AC_COMPILE_IFELSE(
101
[AC_LANG_PROGRAM([],[])],
102
[ac_cv_safe_to_use_floop_parallelize_all_=yes],
103
[ac_cv_safe_to_use_floop_parallelize_all_=no])
100
[ac_cv_safe_to_use_wconversion_=yes],
101
[ac_cv_safe_to_use_wconversion_=no])
104
102
CFLAGS="$save_CFLAGS"])
106
AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
108
F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
104
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
105
[W_CONVERSION="-Wconversion"
106
AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
107
[ac_cv_safe_to_use_Wconversion_],
108
[save_CFLAGS="$CFLAGS"
109
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
110
dnl conversion warnings to all the tarball folks
111
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
115
#include <netinet/in.h>
117
uint16_t x= htons(80);
119
[ac_cv_safe_to_use_Wconversion_=yes],
120
[ac_cv_safe_to_use_Wconversion_=no])
121
CFLAGS="$save_CFLAGS"])
123
AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
124
[NO_CONVERSION="-Wno-conversion"])
111
127
NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
112
128
NO_SHADOW="-Wno-shadow"
114
130
AS_IF([test "$INTELCC" = "yes"],[
115
131
m4_if(PW_LESS_WARNINGS,[no],[
116
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
132
BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
118
dnl 2203 is like old-style-cast
119
dnl 1684 is like strict-aliasing
120
dnl 188 is about using enums as bitfields
121
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"
134
BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
124
136
CC_WARNINGS="${BASE_WARNINGS}"
125
137
CXX_WARNINGS="${BASE_WARNINGS}"
126
PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
129
139
m4_if(PW_LESS_WARNINGS,[no],[
130
BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing"
140
BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
131
141
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
132
142
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
133
NO_OLD_STYLE_CAST="-Wno-old-style-cast"
134
NO_EFF_CXX="-Wno-effc++"
136
BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
144
BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
139
147
AS_IF([test "${ac_cv_assert}" = "no"],
140
148
[NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
142
AC_CACHE_CHECK([whether it is safe to use -Wextra],
143
[ac_cv_safe_to_use_Wextra_],
144
[save_CFLAGS="$CFLAGS"
145
CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
152
[ac_cv_safe_to_use_Wextra_=yes],
153
[ac_cv_safe_to_use_Wextra_=no])
154
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}"
157
AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
158
[BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
159
[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"])
150
BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
237
151
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
238
152
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
304
199
AC_INCLUDES_DEFAULT])],
305
200
[ac_cv_safe_to_use_Wredundant_decls_=yes],
306
201
[ac_cv_safe_to_use_Wredundant_decls_=no])
307
CXXFLAGS="${save_CXXFLAGS}"
202
CXXFLAGS="${save_CXXFLAGS}"
309
204
AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
310
205
[CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
311
206
[CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
313
AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
314
[ac_cv_safe_to_use_Wattributes_],
316
save_CXXFLAGS="${CXXFLAGS}"
317
CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
320
#include <google/protobuf/message.h>
321
#include <google/protobuf/descriptor.h>
324
const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
325
enum Table_TableOptions_RowType {
326
Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
327
Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
328
Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
329
Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
330
Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
331
Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
332
Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
338
inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
339
return Table_TableOptions_RowType_descriptor();
344
[ac_cv_safe_to_use_Wattributes_=yes],
345
[ac_cv_safe_to_use_Wattributes_=no])
346
CXXFLAGS="${save_CXXFLAGS}"
348
AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
349
[ac_cv_safe_to_use_Wno_attributes_],
350
[save_CFLAGS="$CFLAGS"
351
CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
358
[ac_cv_safe_to_use_Wno_attributes_=yes],
359
[ac_cv_safe_to_use_Wno_attributes_=no])
360
CFLAGS="$save_CFLAGS"])
362
dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
364
AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
365
AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
366
CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
367
NO_ATTRIBUTES="-Wno-attributes"])])
370
208
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
371
209
dnl TODO: Figure out a better way to deal with this:
372
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
373
NO_WERROR="-Wno-error"
374
PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
375
PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
376
AS_IF([test "$host_vendor" = "apple"],[
377
BOOSTSKIP_WARNINGS="-Wno-uninitialized"
210
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces"
211
INNOBASE_SKIP_WARNINGS="-Wno-shadow -Wno-cast-align"
408
242
m4_if(PW_LESS_WARNINGS, [no],[
409
CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
243
CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
410
244
CXX_WARNINGS_FULL="-erroff=inllargeuse"
412
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
246
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
413
247
CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
416
250
CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
417
251
CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
418
252
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
419
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
253
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
423
NO_WERROR="-errwarn=%none"