Commit fd2fe58 for zlib
commit fd2fe58bf43f451b04402f38d8787e4100ef48bf
Author: Mark Adler <git@madler.net>
Date: Sun Feb 8 12:40:39 2026 -0800
Add more compiler warnings for ./configure --warn --warn.
diff --git a/configure b/configure
index 27c77c0..58d4cb8 100755
--- a/configure
+++ b/configure
@@ -145,7 +145,7 @@ case "$1" in
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
-c* | --const) zconst=1; shift ;;
- -w* | --warn) warn=1; shift ;;
+ -w* | --warn) warn=$((warn + 1)); shift ;;
-d* | --debug) debug=1; shift ;;
--sanitize) address=1; shift ;;
--address) address=1; shift ;;
@@ -251,11 +251,14 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
fi
- if test "$warn" -eq 1; then
+ if test "$warn" -ge 1; then
CFLAGS="${CFLAGS} -Wall -Wextra"
+ if test "$warn" -ge 2; then
+ CFLAGS="${CFLAGS} -Wconversion -Wshadow -Wundef"
+ fi
fi
if test "$zconst" -eq 1; then
- if test "$warn" -eq 1; then
+ if test "$warn" -ge 1; then
CFLAGS="${CFLAGS} -Wcast-qual"
fi
CFLAGS="${CFLAGS} -DZLIB_CONST"