From: Albert Cahalan <albert@users.sourceforge.net>

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 ++
 arch/mips/Makefile |    1 +
 arch/s390/Makefile |    1 +
 3 files changed, 4 insertions(+)

diff -puN arch/i386/Makefile~wpadded arch/i386/Makefile
--- 25/arch/i386/Makefile~wpadded	2003-07-13 21:54:54.000000000 -0700
+++ 25-akpm/arch/i386/Makefile	2003-07-13 21:54:54.000000000 -0700
@@ -27,6 +27,8 @@ check_gcc = $(shell if $(CC) $(1) -S -o 
 # 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
diff -puN arch/mips/Makefile~wpadded arch/mips/Makefile
--- 25/arch/mips/Makefile~wpadded	2003-07-13 21:54:54.000000000 -0700
+++ 25-akpm/arch/mips/Makefile	2003-07-13 21:54:54.000000000 -0700
@@ -78,6 +78,7 @@ endif
 
 AFLAGS		+= $(cflags-y)
 CFLAGS		+= $(cflags-y)
+CFLAGS		+= $(call check_gcc,-Wpadded,)
 
 
 #
diff -puN arch/s390/Makefile~wpadded arch/s390/Makefile
--- 25/arch/s390/Makefile~wpadded	2003-07-13 21:54:54.000000000 -0700
+++ 25-akpm/arch/s390/Makefile	2003-07-13 21:54:54.000000000 -0700
@@ -38,6 +38,7 @@ cflags-$(CONFIG_MARCH_Z990) += $(call ch
 
 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

_