1187
1187
[AS_HELP_STRING([--enable-fail],
1188
1188
[Turn warnings into failures @<:@default=off@:>@])],
1189
1189
[ac_warn_fail="$enableval"],
1190
[ac_warn_fail="no"])
1190
[ac_warn_fail="yes"])
1192
1192
AC_ARG_ENABLE([unreachable],
1193
1193
[AS_HELP_STRING([--enable-unreachable],
1195
1195
[ac_warn_unreachable="$enableval"],
1196
1196
[ac_warn_unreachable="no"])
1198
AC_ARG_ENABLE([longlong-warnings],
1199
[AS_HELP_STRING([--enable-longlong-warnings],
1200
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1201
[ac_warn_longlong="$enableval"],
1202
[ac_warn_longlong="no"])
1204
AC_ARG_ENABLE([strict-aliasing],
1205
[AS_HELP_STRING([--enable-strict-aliasing],
1206
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1207
[ac_warn_strict_aliasing="$enableval"],
1208
[ac_warn_strict_aliasing="no"])
1199
1211
if test "$GCC" = "yes"
1202
GCC_WARNINGS="-W -Wall -Wextra"
1203
GXX_WARNINGS="${GCC_WARNINGS}"
1214
if test "$ac_warn_longlong" = "yes"
1216
W_LONGLONG="-Wlong-long"
1218
W_LONGLONG="-Wno-long-long"
1221
if test "$ac_warn_strict_aliasing" = "yes"
1223
W_STRICT_ALIASING="-Wstrict-aliasing"
1225
W_STRICT_ALIASING="-Wno-strict_aliasing"
1206
1228
if test "$ac_warn_pedantic" = "yes"
1208
GCC_WARNINGS="${GCC_WARNINGS} -std=gnu99 -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wno-strict-aliasing "
1209
GXX_WARNINGS="${GXX_WARNINGS} -std=gnu++98 -pedantic -Wundef -Wredundant-decls -Wno-long-long -Wno-strict-aliasing"
1230
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1231
GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1212
1234
if test "$ac_warn_unreachable" = "yes"
1214
GCC_WARNINGS="${GCC_WARNINGS} -Wunreachable-code"
1215
GXX_WARNINGS="${GXX_WARNINGS} -Wunreachable-code"
1236
W_UNREACHABLE="-Wunreachable-code"
1218
1239
if test "$ac_warn_fail" = "yes"
1220
GCC_WARNINGS="${GCC_WARNINGS} -Werror"
1221
GXX_WARNINGS="${GXX_WARNINGS} -Werror"
1224
CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1225
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1244
BASE_WARNINGS="-W -Wall -Wextra"
1245
GCC_WARNINGS="${BASE_WARNINGS} -std=gnu99 ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL}"
1246
GXX_WARNINGS="${BASE_WARNINGS} -std=gnu++98 ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL}"
1248
CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1249
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1228
1252
# Some usefull subst