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 9768fd870d4520be
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
     1.1 --- a/configure	Fri Jun 19 23:49:00 2015 -0700
     1.2 +++ b/configure	Fri Jun 19 23:53:33 2015 -0700
     1.3 @@ -18701,43 +18701,6 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 -CheckWarnShadow()
     1.8 -{
     1.9 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wshadow option" >&5
    1.10 -$as_echo_n "checking for GCC -Wshadow option... " >&6; }
    1.11 -    have_gcc_Wshadow=no
    1.12 -
    1.13 -    save_CFLAGS="$CFLAGS"
    1.14 -    CFLAGS="$save_CFLAGS -Wshadow"
    1.15 -    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.16 -/* end confdefs.h.  */
    1.17 -
    1.18 -    int x = 0;
    1.19 -
    1.20 -int
    1.21 -main ()
    1.22 -{
    1.23 -
    1.24 -
    1.25 -  ;
    1.26 -  return 0;
    1.27 -}
    1.28 -_ACEOF
    1.29 -if ac_fn_c_try_compile "$LINENO"; then :
    1.30 -
    1.31 -    have_gcc_Wshadow=yes
    1.32 -
    1.33 -fi
    1.34 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.35 -    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_Wshadow" >&5
    1.36 -$as_echo "$have_gcc_Wshadow" >&6; }
    1.37 -    CFLAGS="$save_CFLAGS"
    1.38 -
    1.39 -    if test x$have_gcc_Wshadow = xyes; then
    1.40 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow"
    1.41 -    fi
    1.42 -}
    1.43 -
    1.44  CheckWayland()
    1.45  {
    1.46      # Check whether --enable-video-wayland was given.
    1.47 @@ -23652,7 +23615,6 @@
    1.48  esac
    1.49  
    1.50  CheckWarnAll
    1.51 -CheckWarnShadow
    1.52  
    1.53  # Verify that we have all the platform specific files we need
    1.54  
     2.1 --- a/configure.in	Fri Jun 19 23:49:00 2015 -0700
     2.2 +++ b/configure.in	Fri Jun 19 23:53:33 2015 -0700
     2.3 @@ -1159,28 +1159,6 @@
     2.4      fi
     2.5  }
     2.6  
     2.7 -dnl See if GCC's -Wshadow is supported.
     2.8 -CheckWarnShadow()
     2.9 -{
    2.10 -    AC_MSG_CHECKING(for GCC -Wshadow option)
    2.11 -    have_gcc_Wshadow=no
    2.12 -
    2.13 -    save_CFLAGS="$CFLAGS"
    2.14 -    CFLAGS="$save_CFLAGS -Wshadow"
    2.15 -    AC_TRY_COMPILE([
    2.16 -    int x = 0;
    2.17 -    ],[
    2.18 -    ],[
    2.19 -    have_gcc_Wshadow=yes
    2.20 -    ])
    2.21 -    AC_MSG_RESULT($have_gcc_Wshadow)
    2.22 -    CFLAGS="$save_CFLAGS"
    2.23 -
    2.24 -    if test x$have_gcc_Wshadow = xyes; then
    2.25 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow"
    2.26 -    fi
    2.27 -}
    2.28 -
    2.29  dnl Check for Wayland
    2.30  CheckWayland()
    2.31  {
    2.32 @@ -3415,7 +3393,6 @@
    2.33  
    2.34  dnl Do this on all platforms, after everything else.
    2.35  CheckWarnAll
    2.36 -CheckWarnShadow
    2.37  
    2.38  # Verify that we have all the platform specific files we need
    2.39