about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-08-27 20:39:41 -0400
committerRich Felker <dalias@aerifal.cx>2020-08-27 20:39:41 -0400
commit0a312d34b98940f6543b4ae07077d1d59d0afe5b (patch)
treee7862f3507cd1492ae145bf3db4623a4bb09db73 /configure
parente7f808e3595ad3111edec57270bdc088f64a418b (diff)
downloadmusl-0a312d34b98940f6543b4ae07077d1d59d0afe5b.tar.gz
musl-0a312d34b98940f6543b4ae07077d1d59d0afe5b.tar.xz
musl-0a312d34b98940f6543b4ae07077d1d59d0afe5b.zip
configure: use additive warnings instead of subtracting from -Wall
-Wall varies too much by compiler and version. rather than trying to
track all the unwanted style warnings that need to be subtracted, just
enable wanted warnings.

also, move -Wno-pointer-to-int-cast outside --enable-warnings
conditional so that it always applies, since it's turning off a
nuisance warning that's on-by-default with most compilers.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 15 insertions, 9 deletions
diff --git a/configure b/configure
index 5b63e9b1..9fc74a9b 100755
--- a/configure
+++ b/configure
@@ -508,10 +508,13 @@ fi
 #
 # GCC defines -w as overriding any -W options, regardless of order, but
 # clang has a bunch of annoying warnings enabled by default and needs -w
-# to start from a clean slate. So use -w if building with clang.
+# to start from a clean slate. So use -w if building with clang. Also
+# turn off a common on-by-default cast warning regardless of compiler.
 #
 test "$cc_family" = clang && tryflag CFLAGS_AUTO -w
 
+tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
+
 #
 # Even with -std=c99, gcc accepts some constructs which are constraint
 # violations. We want to treat these as errors regardless of whether
@@ -535,14 +538,17 @@ tryflag CFLAGS_AUTO -Werror=discarded-array-qualifiers
 test "$cc_family" = clang && tryflag CFLAGS_AUTO -Qunused-arguments
 
 if test "x$warnings" = xyes ; then
-tryflag CFLAGS_AUTO -Wall
-tryflag CFLAGS_AUTO -Wno-parentheses
-tryflag CFLAGS_AUTO -Wno-uninitialized
-tryflag CFLAGS_AUTO -Wno-missing-braces
-tryflag CFLAGS_AUTO -Wno-unused-value
-tryflag CFLAGS_AUTO -Wno-unused-but-set-variable
-tryflag CFLAGS_AUTO -Wno-unknown-pragmas
-tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
+tryflag CFLAGS_AUTO -Waddress
+tryflag CFLAGS_AUTO -Warray-bounds
+tryflag CFLAGS_AUTO -Wchar-subscripts
+tryflag CFLAGS_AUTO -Wduplicate-decl-specifier
+tryflag CFLAGS_AUTO -Winit-self
+tryflag CFLAGS_AUTO -Wreturn-type
+tryflag CFLAGS_AUTO -Wsequence-point
+tryflag CFLAGS_AUTO -Wstrict-aliasing
+tryflag CFLAGS_AUTO -Wunused-function
+tryflag CFLAGS_AUTO -Wunused-label
+tryflag CFLAGS_AUTO -Wunused-variable
 fi
 
 # Determine if the compiler produces position-independent code (PIC)