summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-12 04:17:24 +0200
committerLasse Collin <lasse.collin@tukaani.org>2023-01-12 04:17:24 +0200
commit5ce6ddc221d0bfb57d810d845bb65fb0aac0b008 (patch)
tree34ff27d6aba709128e838e29082b6e3436b2bc93 /configure.ac
parentbfc3a0a8ac16de90049c1b1ba1445a7626d0230c (diff)
downloadxz-5ce6ddc221d0bfb57d810d845bb65fb0aac0b008.tar.gz
Build: Make configure add more warning flags for GCC and Clang.
-Wstrict-aliasing was removed from the list since it is enabled by -Wall already. A normal build is clean with these on GNU/Linux x86-64 with GCC 12.2.0 and Clang 14.0.6.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 31 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 07cff50..670d3bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1029,26 +1029,35 @@ if test "$GCC" = yes ; then
# backed up with "return LZMA_PROG_ERROR".
# * -Wcast-qual would break various things where we need a non-const
# pointer although we don't modify anything through it.
- # * -Wcast-align breaks optimized CRC32 and CRC64 implementation
- # on some architectures (not on x86), where this warning is bogus,
- # because we take care of correct alignment.
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
# don't seem so useful here; at least the last one gives some
# warnings which are not bugs.
+ # * -Wconversion still shows too many warnings.
+ #
+ # The flags before the empty line are for GCC and many of them
+ # are supported by Clang too. The flags after the empty line are
+ # for Clang.
for NEW_FLAG in \
-Wall \
-Wextra \
-Wvla \
+ -Wc99-c11-compat \
-Wformat=2 \
-Winit-self \
-Wmissing-include-dirs \
- -Wstrict-aliasing \
+ -Wshift-overflow=2 \
+ -Wstrict-overflow=3 \
+ -Walloc-zero \
+ -Wduplicated-cond \
-Wfloat-equal \
-Wundef \
-Wshadow \
-Wpointer-arith \
-Wbad-function-cast \
-Wwrite-strings \
+ -Wdate-time \
+ -Wsign-conversion \
+ -Wfloat-conversion \
-Wlogical-op \
-Waggregate-return \
-Wstrict-prototypes \
@@ -1056,7 +1065,24 @@ if test "$GCC" = yes ; then
-Wmissing-prototypes \
-Wmissing-declarations \
-Wmissing-noreturn \
- -Wredundant-decls
+ -Wredundant-decls \
+ \
+ -Wc99-compat \
+ -Wc11-extensions \
+ -Wc2x-compat \
+ -Wc2x-extensions \
+ -Wpre-c2x-compat \
+ -Warray-bounds-pointer-arithmetic \
+ -Wassign-enum \
+ -Wconditional-uninitialized \
+ -Wdocumentation \
+ -Wduplicate-enum \
+ -Wempty-translation-unit \
+ -Wflexible-array-extensions \
+ -Wmissing-variable-declarations \
+ -Wnewline-eof \
+ -Wshift-sign-overflow \
+ -Wstring-conversion
do
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
OLD_CFLAGS="$CFLAGS"