]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Compile with -Wshadow
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 29 Jul 2015 11:50:38 +0000 (13:50 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 29 Jul 2015 11:50:38 +0000 (13:50 +0200)
aclocal.m4
configure

index 223f9384a19caf2f3c4ec141599df9c8b169942b..18d7ea68c24a3e194498a1190afd2c9a360a68d5 100644 (file)
@@ -948,6 +948,7 @@ AC_DEFUN(AC_LBL_DEVEL,
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wwrite-strings)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wcast-qual)
+                   AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow)
                    AC_LBL_CHECK_COMPILER_OPT($1, -W)
            fi
            AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
index 2b0e1b549239c276820f807f5617002ee300d5c2..0c96b17b3f359f66eabee58aefe975871bda9d66 100755 (executable)
--- a/configure
+++ b/configure
@@ -7848,6 +7848,38 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wshadow option" >&5
+$as_echo_n "checking whether the compiler supports the -Wshadow option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wshadow"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wshadow"
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -W option" >&5
 $as_echo_n "checking whether the compiler supports the -W option... " >&6; }
        save_CFLAGS="$CFLAGS"