GCC is warning about global functions with the same name as variables in the code, when using -Wshadow.
authorSam Lantinga <slouken@libsdl.org>
Fri, 19 Jun 2015 23:53:33 -0700
changeset 9768 fd870d4520be
parent 9767 3622b6b734ac
child 9769 4716db508b0d
GCC is warning about global functions with the same name as variables in the code, when using -Wshadow. This is a little ridiculous because we have no idea what functions a given platform will provide, so we'll disable -Wshadow for now.
configure
configure.in
--- a/configure	Fri Jun 19 23:49:00 2015 -0700
+++ b/configure	Fri Jun 19 23:53:33 2015 -0700
@@ -18701,43 +18701,6 @@
     fi
 }
 
-CheckWarnShadow()
-{
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wshadow option" >&5
-$as_echo_n "checking for GCC -Wshadow option... " >&6; }
-    have_gcc_Wshadow=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -Wshadow"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    int x = 0;
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_gcc_Wshadow=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_Wshadow" >&5
-$as_echo "$have_gcc_Wshadow" >&6; }
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_Wshadow = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow"
-    fi
-}
-
 CheckWayland()
 {
     # Check whether --enable-video-wayland was given.
@@ -23652,7 +23615,6 @@
 esac
 
 CheckWarnAll
-CheckWarnShadow
 
 # Verify that we have all the platform specific files we need
 
--- a/configure.in	Fri Jun 19 23:49:00 2015 -0700
+++ b/configure.in	Fri Jun 19 23:53:33 2015 -0700
@@ -1159,28 +1159,6 @@
     fi
 }
 
-dnl See if GCC's -Wshadow is supported.
-CheckWarnShadow()
-{
-    AC_MSG_CHECKING(for GCC -Wshadow option)
-    have_gcc_Wshadow=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -Wshadow"
-    AC_TRY_COMPILE([
-    int x = 0;
-    ],[
-    ],[
-    have_gcc_Wshadow=yes
-    ])
-    AC_MSG_RESULT($have_gcc_Wshadow)
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_Wshadow = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow"
-    fi
-}
-
 dnl Check for Wayland
 CheckWayland()
 {
@@ -3415,7 +3393,6 @@
 
 dnl Do this on all platforms, after everything else.
 CheckWarnAll
-CheckWarnShadow
 
 # Verify that we have all the platform specific files we need