]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Disable dangling pointer checking for GCC
authorMichael Brown <mcb30@ipxe.org>
Wed, 14 Dec 2022 01:26:03 +0000 (01:26 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 14 Dec 2022 01:29:49 +0000 (01:29 +0000)
The dangling pointer warning introduced in GCC 12 reports false
positives that result in build failures.  In particular, storing the
address of a local code label used to record the current state of a
state machine (as done in crypto/deflate.c) is reported as an error.

There seems to be no way to mark the pointer type as being permitted
to hold such a value, so unconditionally disable the warning.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping

index 61a9cf07e04707ae48a2b6ac3e9f3695503d511a..658b84b6bd422c335ad8e23e36b3c824f0053169 100644 (file)
@@ -461,8 +461,10 @@ CFLAGS             += -g
 ifeq ($(CCTYPE),gcc)
 CFLAGS         += -ffreestanding
 CFLAGS         += -fcommon
-CFLAGS         += -Wall -W -Wformat-nonliteral -Wno-array-bounds
-HOST_CFLAGS    += -Wall -W -Wformat-nonliteral -Wno-array-bounds
+CFLAGS         += -Wall -W -Wformat-nonliteral
+CFLAGS         += -Wno-array-bounds -Wno-dangling-pointer
+HOST_CFLAGS    += -Wall -W -Wformat-nonliteral
+HOST_CFLAGS    += -Wno-array-bounds -Wno-dangling-pointer
 endif
 CFLAGS         += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
 ASFLAGS                += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)