GCC 9.0 introduces a new warning for using pointers to packed
structure and union members. ipxe code is replete with this usage,
partly because the architectures it is designed for handle unaligned
accesses. Therefore this warning is not very helpful and since the
default build considers warnings to be errors, needs to be disabled.

Signed-off-by: Bruce Rogers <brog...@suse.com>
---
 src/Makefile.housekeeping | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index f8334921..e7f1ece0 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -185,6 +185,17 @@ WNST_TEST = $(CC) -Wstringop-truncation -x c -c /dev/null 
-o /dev/null \
                  >/dev/null 2>&1
 WNST_FLAGS := $(shell $(WNST_TEST) && $(ECHO) '-Wno-stringop-truncation')
 WORKAROUND_CFLAGS += $(WNST_FLAGS)
+
+# GCC 9.0 introduces a new warning for using pointers to packed
+# structure and union members. ipxe code is replete with this usage,
+# partly because the architectures it is designed for handle unaligned
+# accesses. Therefore this warning is not very helpful and since the 
+# default build considers warnings to be errors, needs to be disabled.
+#
+WNAOPM_TEST = $(CC) -Waddress-of-packed-member -x c -c /dev/null -o /dev/null \
+                 >/dev/null 2>&1
+WNAOPM_FLAGS := $(shell $(WNAOPM_TEST) && $(ECHO) 
'-Wno-address-of-packed-member')
+WORKAROUND_CFLAGS += $(WNAOPM_FLAGS)
 endif
 
 # Some versions of gas choke on division operators, treating them as
-- 
2.20.1

_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to