提交 631e2f15 编写于 作者: J jprovino

8008474: Add -Wundef to warning flags.

Summary: Force use of undefined macros to be and error.
Reviewed-by: dholmes, mikael
上级 f993d166
...@@ -168,12 +168,12 @@ endif ...@@ -168,12 +168,12 @@ endif
# conversions which might affect the values. To avoid that, we need to turn # conversions which might affect the values. To avoid that, we need to turn
# it off explicitly. # it off explicitly.
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
else else
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
endif endif
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
# Special cases # Special cases
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
# XXXDARWIN: for _dyld_bind_fully_image_containing_address # XXXDARWIN: for _dyld_bind_fully_image_containing_address
......
...@@ -131,12 +131,12 @@ WARNINGS_ARE_ERRORS = -Werror ...@@ -131,12 +131,12 @@ WARNINGS_ARE_ERRORS = -Werror
# conversions which might affect the values. To avoid that, we need to turn # conversions which might affect the values. To avoid that, we need to turn
# it off explicitly. # it off explicitly.
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
else else
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
endif endif
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
# Special cases # Special cases
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
......
...@@ -118,8 +118,8 @@ endif ...@@ -118,8 +118,8 @@ endif
# Compiler warnings are treated as errors # Compiler warnings are treated as errors
WARNINGS_ARE_ERRORS = -Werror WARNINGS_ARE_ERRORS = -Werror
# Enable these warnings. See 'info gcc' about details on these options # Enable these warnings. See 'info gcc' about details on these options
ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS) CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
# Special cases # Special cases
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册