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/$@)) |