linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] gcc -Wpadded
Date: 12 Jul 2003 18:57:20 -0400	[thread overview]
Message-ID: <1058050640.751.1324.camel@cube> (raw)

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




                 reply	other threads:[~2003-07-12 22:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1058050640.751.1324.camel@cube \
    --to=albert@users.sf.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).