build: configure.ac: always set -fno-strict-aliasing

We break the aliasing rules in the code, and thus the flag should
always be enabled to prevent wrong optimizations, even without
--enable-more-warnings.
This commit is contained in:
Beniamino Galvani 2016-05-20 15:34:26 +02:00
parent 76eca6aca9
commit b5daaf43bc
2 changed files with 6 additions and 1 deletions

View file

@ -920,6 +920,11 @@ AM_CONDITIONAL(BUILD_NMTUI, test "$build_nmtui" = yes)
NM_COMPILER_WARNINGS
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-fno-strict-aliasing \
])
CFLAGS="$CFLAGS $with_cflags"
AC_ARG_ENABLE(more-asserts,
AS_HELP_STRING([--enable-more-asserts], [Enable more assertions for debugging (default: no). Deprecated option. Use --with-more-asserts=level]))
more_asserts=0

View file

@ -66,7 +66,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
-Wno-duplicate-decl-specifier \
-Wstrict-prototypes \
-fno-strict-aliasing -Wno-unused-but-set-variable \
-Wno-unused-but-set-variable \
-Wundef -Wimplicit-function-declaration \
-Wpointer-arith -Winit-self -Wformat-nonliteral \
-Wmissing-include-dirs -Wno-pragmas; do