mike_m pushed a commit to branch master.
commit 6777b743d2d63d8582b538200bb182e0258078b3
Author: Mike McCormack <[email protected]>
Date: Wed Apr 3 22:39:57 2013 +1100
Check for -Wshadow warnings with globals
Signed-off-by: Mike McCormack <[email protected]>
---
configure.ac | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ec34890..39d6693 100644
--- a/configure.ac
+++ b/configure.ac
@@ -357,7 +357,15 @@ EFL_CHECK_COMPILER_FLAGS([EFL], [-Wall -Wextra
-Wpointer-arith -Wno-missing-fiel
EFL_CHECK_LINKER_FLAGS([EFL], [-fvisibility=hidden -fdata-sections
-ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed
-Wl,--no-copy-dt-needed-entries])
case "${build_profile}" in
dev)
- EFL_CHECK_COMPILER_FLAGS([EFL], [-Wshadow])
+ dnl Check if compiler has a dodgy -Wshadow that emits errors when
shadowing a global
+ AC_MSG_CHECKING([whether -Wshadow generates spurious warnings])
+ CFLAGS_save="${CFLAGS}"
+ CFLAGS="${CFLAGS} -Werror -Wshadow"
+ AC_TRY_COMPILE([int x;], [int x = 0; (void)x;],
+ [AC_MSG_RESULT([no])
+ EFL_CHECK_COMPILER_FLAGS([EFL], [-Wshadow])],
+ [AC_MSG_RESULT([yes])])
+ CFLAGS="${CFLAGS_save}"
;;
debug)
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html