linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gcc -Wpadded
@ 2003-07-12 22:57 Albert Cahalan
  0 siblings, 0 replies; only message in thread
From: Albert Cahalan @ 2003-07-12 22:57 UTC (permalink / raw)
  To: linux-kernel

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.

diff -Naurd old/arch/i386/Makefile new/arch/i386/Makefile
--- old/arch/i386/Makefile	2003-07-12 18:36:52.000000000 -0400
+++ new/arch/i386/Makefile	2003-07-12 18:47:01.000000000 -0400
@@ -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
diff -Naurd old/arch/mips/Makefile new/arch/mips/Makefile
--- old/arch/mips/Makefile	2003-07-12 18:42:12.000000000 -0400
+++ new/arch/mips/Makefile	2003-07-12 18:46:21.000000000 -0400
@@ -78,6 +78,7 @@
 
 AFLAGS		+= $(cflags-y)
 CFLAGS		+= $(cflags-y)
+CFLAGS		+= $(call check_gcc,-Wpadded,)
 
 
 #
diff -Naurd old/arch/s390/Makefile new/arch/s390/Makefile
--- old/arch/s390/Makefile	2003-07-12 18:41:49.000000000 -0400
+++ new/arch/s390/Makefile	2003-07-12 18:44:41.000000000 -0400
@@ -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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-12 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-12 22:57 [PATCH] gcc -Wpadded Albert Cahalan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).