8008474: Add -Wundef to warning flags.

Wed, 06 Mar 2013 13:50:54 -0500

author
jprovino
date
Wed, 06 Mar 2013 13:50:54 -0500
changeset 4722
67342b960b47
parent 4721
47bc9800972c
child 4723
cb75b67f04fb

8008474: Add -Wundef to warning flags.
Summary: Force use of undefined macros to be and error.
Reviewed-by: dholmes, mikael

make/bsd/makefiles/gcc.make file | annotate | diff | comparison | revisions
make/linux/makefiles/gcc.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/gcc.make file | annotate | diff | comparison | revisions
     1.1 --- a/make/bsd/makefiles/gcc.make	Wed Mar 06 13:46:55 2013 -0500
     1.2 +++ b/make/bsd/makefiles/gcc.make	Wed Mar 06 13:50:54 2013 -0500
     1.3 @@ -168,12 +168,12 @@
     1.4  # conversions which might affect the values. To avoid that, we need to turn
     1.5  # it off explicitly. 
     1.6  ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
     1.7 -ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
     1.8 +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
     1.9  else
    1.10 -ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
    1.11 +WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
    1.12  endif
    1.13  
    1.14 -CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
    1.15 +CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
    1.16  # Special cases
    1.17  CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 
    1.18  # XXXDARWIN: for _dyld_bind_fully_image_containing_address
     2.1 --- a/make/linux/makefiles/gcc.make	Wed Mar 06 13:46:55 2013 -0500
     2.2 +++ b/make/linux/makefiles/gcc.make	Wed Mar 06 13:50:54 2013 -0500
     2.3 @@ -131,12 +131,12 @@
     2.4  # conversions which might affect the values. To avoid that, we need to turn
     2.5  # it off explicitly. 
     2.6  ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
     2.7 -ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
     2.8 +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
     2.9  else
    2.10 -ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
    2.11 +WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
    2.12  endif
    2.13  
    2.14 -CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
    2.15 +CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
    2.16  # Special cases
    2.17  CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 
    2.18  
     3.1 --- a/make/solaris/makefiles/gcc.make	Wed Mar 06 13:46:55 2013 -0500
     3.2 +++ b/make/solaris/makefiles/gcc.make	Wed Mar 06 13:50:54 2013 -0500
     3.3 @@ -118,8 +118,8 @@
     3.4  # Compiler warnings are treated as errors 
     3.5  WARNINGS_ARE_ERRORS = -Werror 
     3.6  # Enable these warnings. See 'info gcc' about details on these options
     3.7 -ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare 
     3.8 -CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS) 
     3.9 +WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
    3.10 +CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
    3.11  # Special cases 
    3.12  CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))  
    3.13  

mercurial