diff options
author | Michael Brown | 2011-03-16 19:10:49 +0100 |
---|---|---|
committer | Michael Brown | 2011-03-16 20:32:17 +0100 |
commit | c8e51f80a8baa5f595b7d19a8098a7b066bc5c3d (patch) | |
tree | 6ee316b2529e37e300627bd158f3685b8e021d25 /src/Makefile.housekeeping | |
parent | [build] Avoid spurious unused-but-set-variable warnings in gcc 4.6 (diff) | |
download | ipxe-c8e51f80a8baa5f595b7d19a8098a7b066bc5c3d.tar.gz ipxe-c8e51f80a8baa5f595b7d19a8098a7b066bc5c3d.tar.xz ipxe-c8e51f80a8baa5f595b7d19a8098a7b066bc5c3d.zip |
[build] Avoid spurious address comparison warnings in gcc 4.6
A construction such as "assert ( ptr != NULL )" seems to trigger a
false positive warning in gcc 4.6 if the value of "ptr" is known at
compile-time to be non-NULL. Use -Wno-address to inhibit this
warning.
Reported-by: Ralph Giles <giles@thaumas.net>
Tested-by: Ralph Giles <giles@thaumas.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r-- | src/Makefile.housekeeping | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 78e78c99..964d5009 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -148,6 +148,15 @@ CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm') WORKAROUND_CFLAGS += $(CFI_FLAGS) endif +# gcc 4.6 generates spurious warnings if -Waddress is in force. +# Inhibit this. +# +ifeq ($(CCTYPE),gcc) +WNA_TEST = $(CC) -Wno-address -x c -c /dev/null -o /dev/null >/dev/null 2>&1 +WNA_FLAGS := $(shell $(WNA_TEST) && $(ECHO) '-Wno-address') +WORKAROUND_CFLAGS += $(WNA_FLAGS) +endif + # Some versions of gas choke on division operators, treating them as # comment markers. Specifying --divide will work around this problem, # but isn't available on older gas versions. |