comparison 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
comparison
equal deleted inserted replaced
9059:17bf4d428955 9060:cc32ccaaf47f
124 endif 124 endif
125 125
126 # Compiler warnings are treated as errors 126 # Compiler warnings are treated as errors
127 WARNINGS_ARE_ERRORS = -Werror 127 WARNINGS_ARE_ERRORS = -Werror
128 128
129 # Except for a few acceptable ones 129 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function
130
130 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit 131 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
131 # conversions which might affect the values. To avoid that, we need to turn 132 # conversions which might affect the values. Only enable it in earlier versions.
132 # it off explicitly. 133 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
133 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 134 WARNING_FLAGS += -Wconversion
134 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
135 else
136 WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
137 endif 135 endif
138 136
139 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) 137 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
140 # Special cases 138 # Special cases
141 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 139 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))