aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-04-16 18:40:53 +0200
committerJay Berkenbilt <ejb@ql.org>2020-04-16 18:41:43 +0200
commit734ab587649f27dcb44458cfb43cf809ffdd9fc5 (patch)
tree6efdfb17927c7f6f48dff39f32e5fde5ef712451 /configure
parent92d3cbecd4ea375d8de95bffc0fe8651c698f568 (diff)
downloadqpdf-734ab587649f27dcb44458cfb43cf809ffdd9fc5.tar.zst
Use -Wshadow=local if supported
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure67
1 files changed, 54 insertions, 13 deletions
diff --git a/configure b/configure
index 9703878f..d6aebce8 100755
--- a/configure
+++ b/configure
@@ -785,7 +785,6 @@ enable_largefile
enable_ld_version_script
with_buildrules
enable_werror
-enable_int_warnings
enable_implicit_crypto
enable_crypto_native
enable_crypto_openssl
@@ -1473,8 +1472,6 @@ Optional Features:
--enable-ld-version-script
enable linker version script (default is enabled)
--enable-werror whether to treat warnings as errors (default is no)
- --enable-int-warnings whether to turn on integer type warnings (default is
- yes)
--enable-implicit-crypto
whether to enable available crypto providers that
are not explicitly requested; true by default
@@ -17631,26 +17628,70 @@ if test "$BUILDRULES" = "msvc"; then
else
try_flags="-Wconversion -Wsign-conversion"
fi
+oCFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $try_flags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use $try_flags" >&5
$as_echo_n "checking for whether to use $try_flags... " >&6; }
-# Check whether --enable-int-warnings was given.
-if test "${enable_int_warnings+set}" = set; then :
- enableval=$enable_int_warnings; if test "$enableval" = "yes"; then
- qpdf_INT_WARNINGS=1;
- else
- qpdf_INT_WARNINGS=0;
- fi
-else
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int a = 1; int b = a; a = b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
qpdf_INT_WARNINGS=1
+else
+ qpdf_INT_WARNINGS=0
fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$qpdf_INT_WARNINGS" = "1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- WFLAGS="$WFLAGS $try_flags"
+ CXXFLAGS="$CXXFLAGS $try_flags"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+ CFLAGS=$oCFLAGS
+fi
+
+if test "$BUILDRULES" != "msvc"; then
+ try_flags="-Wshadow=local"
+ oCFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $try_flags -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use $try_flags" >&5
+$as_echo_n "checking for whether to use $try_flags... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int a = 1; int b = a; a = b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ qpdf_SHADOW_WARNINGS=1
+else
+ qpdf_SHADOW_WARNINGS=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test "$qpdf_SHADOW_WARNINGS" = "1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ CFLAGS="$oCFLAGS $try_flags"
+ CXXFLAGS="$CXXFLAGS $try_flags"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS=$oCFLAGS
+ fi
fi