87
87
F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
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"])
167
90
NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
168
91
NO_SHADOW="-Wno-shadow"
170
93
AS_IF([test "$INTELCC" = "yes"],[
171
94
m4_if(PW_LESS_WARNINGS,[no],[
172
BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
95
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
174
97
dnl 2203 is like old-style-cast
175
98
dnl 1684 is like strict-aliasing
176
99
dnl 188 is about using enums as bitfields
177
100
dnl 1683 is a warning about _EXPLICIT_ casting, which we want
178
BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
101
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
180
103
CC_WARNINGS="${BASE_WARNINGS}"
181
104
CXX_WARNINGS="${BASE_WARNINGS}"
185
108
m4_if(PW_LESS_WARNINGS,[no],[
186
BASE_WARNINGS_FULL="${W_FORMAT_2} ${W_CONVERSION} -Wstrict-aliasing"
109
BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing"
187
110
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
188
111
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
189
112
NO_OLD_STYLE_CAST="-Wno-old-style-cast"
190
113
NO_EFF_CXX="-Wno-effc++"
192
BASE_WARNINGS_FULL="${W_FORMAT_2} ${NO_STRICT_ALIASING}"
115
BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
195
118
AS_IF([test "${ac_cv_assert}" = "no"],
214
137
[BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
215
138
[BASE_WARNINGS="${BASE_WARNINGS} -W"])
140
AC_CACHE_CHECK([whether it is safe to use -Wformat],
141
[ac_cv_safe_to_use_wformat_],
142
[save_CFLAGS="$CFLAGS"
143
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
144
dnl conversion warnings to all the tarball folks
145
CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
150
#include <inttypes.h>
155
printf("This is a %" PRIu64 "test\n", test_u);
160
[ac_cv_safe_to_use_wformat_=yes],
161
[ac_cv_safe_to_use_wformat_=no])
162
CFLAGS="$save_CFLAGS"])
163
AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
164
BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wno-format-security"
165
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wno-format-security"
167
BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
168
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
173
AC_CACHE_CHECK([whether it is safe to use -Wconversion],
174
[ac_cv_safe_to_use_wconversion_],
175
[save_CFLAGS="$CFLAGS"
176
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
177
dnl conversion warnings to all the tarball folks
178
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
189
[ac_cv_safe_to_use_wconversion_=yes],
190
[ac_cv_safe_to_use_wconversion_=no])
191
CFLAGS="$save_CFLAGS"])
193
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
194
[W_CONVERSION="-Wconversion"
195
AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
196
[ac_cv_safe_to_use_Wconversion_],
197
[save_CFLAGS="$CFLAGS"
198
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
199
dnl conversion warnings to all the tarball folks
200
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
204
#include <netinet/in.h>
206
uint16_t x= htons(80);
208
[ac_cv_safe_to_use_Wconversion_=yes],
209
[ac_cv_safe_to_use_Wconversion_=no])
210
CFLAGS="$save_CFLAGS"])
212
AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
213
[NO_CONVERSION="-Wno-conversion"])
217
216
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
218
217
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"