166 # Except for a few acceptable ones |
166 # Except for a few acceptable ones |
167 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
167 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
168 # conversions which might affect the values. To avoid that, we need to turn |
168 # conversions which might affect the values. To avoid that, we need to turn |
169 # it off explicitly. |
169 # it off explicitly. |
170 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
170 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
171 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare |
171 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef |
172 else |
172 else |
173 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare |
173 WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef |
174 endif |
174 endif |
175 |
175 |
176 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) |
176 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) |
177 # Special cases |
177 # Special cases |
178 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
178 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
179 # XXXDARWIN: for _dyld_bind_fully_image_containing_address |
179 # XXXDARWIN: for _dyld_bind_fully_image_containing_address |
180 ifeq ($(OS_VENDOR), Darwin) |
180 ifeq ($(OS_VENDOR), Darwin) |
181 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations |
181 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations |