mirror of
https://github.com/ipxe/ipxe
synced 2025-12-16 09:32:33 +03:00
[build] Disable array bounds checking for GCC
The array bounds checker on GCC 12 and newer reports a very large number of false positives that result in build failures. In particular, accesses through pointers to zero-length arrays (such as those used by the linker table mechanism in include/ipxe/tables.h) are reported as errors, contrary to the GCC documentation. Work around this GCC issue by unconditionally disabling the warning. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -461,8 +461,8 @@ CFLAGS += -g
|
|||||||
ifeq ($(CCTYPE),gcc)
|
ifeq ($(CCTYPE),gcc)
|
||||||
CFLAGS += -ffreestanding
|
CFLAGS += -ffreestanding
|
||||||
CFLAGS += -fcommon
|
CFLAGS += -fcommon
|
||||||
CFLAGS += -Wall -W -Wformat-nonliteral
|
CFLAGS += -Wall -W -Wformat-nonliteral -Wno-array-bounds
|
||||||
HOST_CFLAGS += -Wall -W -Wformat-nonliteral
|
HOST_CFLAGS += -Wall -W -Wformat-nonliteral -Wno-array-bounds
|
||||||
endif
|
endif
|
||||||
CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
|
CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
|
||||||
ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
|
ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
|
||||||
|
|||||||
Reference in New Issue
Block a user