mirror of
https://github.com/ipxe/ipxe
synced 2026-10-07 15:05:42 +03:00
[build] Enable strict shift overflow warnings
Left shifts into the sign bit are often reported as potential undefined behaviour by automated tools, which distracts from real issues. Now that all offending constant left shifts have been eliminated from the codebase, enable -Wshift-overflow=2 to ensure that such shifts cannot be reintroduced in future. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -488,9 +488,9 @@ CFLAGS += -g
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -ffreestanding
|
||||
CFLAGS += -fno-common
|
||||
CFLAGS += -Wall -W -Wformat-nonliteral
|
||||
CFLAGS += -Wall -W -Wformat-nonliteral -Wshift-overflow=2
|
||||
CFLAGS += -Wno-array-bounds -Wno-dangling-pointer
|
||||
HOST_CFLAGS += -Wall -W -Wformat-nonliteral
|
||||
HOST_CFLAGS += -Wall -W -Wformat-nonliteral -Wshift-overflow=2
|
||||
HOST_CFLAGS += -Wno-array-bounds -Wno-dangling-pointer
|
||||
endif
|
||||
CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
|
||||
|
||||
Reference in New Issue
Block a user