gcc -Wpadded
PATCH 1/1 gcc -Wpadded
Explicit padding is better than compiler-generated padding, because awareness of the issue reduces waste. There's also a security issue, with info leaking whenever padded structs get copied to the user.
This patch adds -Wpadded for i386, mips, and s390.
arch/i386/Makefile +2 -0
@@ -27,6 +27,8 @@ # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) +CFLAGS += $(call check_gcc,-Wpadded,) + align := $(subst -functions=0,,$(call
check_gcc,-falign-functions=0,-malign-functions=0))
cflags-$(CONFIG_M386) += -march=i386
arch/mips/Makefile +1 -0
@@ -78,6 +78,7 @@ AFLAGS += $(cflags-y) CFLAGS += $(cflags-y) +CFLAGS += $(call check_gcc,-Wpadded,) #
arch/s390/Makefile +1 -0
@@ -38,6 +38,7 @@ CFLAGS += $(cflags-y) CFLAGS += $(call check_gcc,-finline-limit=10000,) +CFLAGS += $(call check_gcc,-Wpadded,) CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare OBJCOPYFLAGS := -O binary