mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 21:47:44 +00:00
Partial fix for bug 2556 - add compilation flag -Wshadow
I added -Wshadow and then turned it off again because of massive variable shadowing in the blit macros. Feel free to go through that code and fix these if you want. Just uncomment CheckWarnShadow in configure.in if you want to try this.
This commit is contained in:
38
configure
vendored
38
configure
vendored
@@ -18684,6 +18684,43 @@ $as_echo "$need_gcc_Wno_multichar" >&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.
|
||||
@@ -23337,6 +23374,7 @@ $as_echo "#define SDL_FILESYSTEM_NACL 1" >>confdefs.h
|
||||
esac
|
||||
|
||||
CheckWarnAll
|
||||
#CheckWarnShadow
|
||||
|
||||
# Verify that we have all the platform specific files we need
|
||||
|
||||
|
||||
Reference in New Issue
Block a user