diff make/linux/makefiles/gcc.make @ 9060:cc32ccaaf47f

8003310: Enable -Wunused-function when compiling with gcc Summary: Add the -Wunused-function flag and remove a number of unused functions. Reviewed-by: dholmes, coleenp, kvn
author mikael
date Thu, 04 Apr 2013 10:01:26 -0700
parents 67342b960b47
children 2cb5d5f6d5e5
line wrap: on
line diff
--- a/make/linux/makefiles/gcc.make	Wed Apr 03 16:43:09 2013 -0700
+++ b/make/linux/makefiles/gcc.make	Thu Apr 04 10:01:26 2013 -0700
@@ -126,14 +126,12 @@
 # Compiler warnings are treated as errors
 WARNINGS_ARE_ERRORS = -Werror
 
-# Except for a few acceptable ones
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function
+
 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
-# conversions which might affect the values. To avoid that, we need to turn
-# it off explicitly. 
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
-else
-WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
+# conversions which might affect the values. Only enable it in earlier versions.
+ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+WARNING_FLAGS += -Wconversion
 endif
 
 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)