public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* __packed vs. __attribute__((packed)) in kernel headers
@ 2011-06-22  6:34 Markus Trippelsdorf
  2011-06-23 13:42 ` Nick Bowler
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Markus Trippelsdorf @ 2011-06-22  6:34 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Mike Frysinger, Sam Ravnborg, Artem Bityutskiy

A recent commit 3627924acf70a changed __attribute__ ((packed)) to
__packed in some UBI headers. This breaks the build of busybox:

  CC      miscutils/ubi_attach_detach.o
In file included from miscutils/ubi_attach_detach.c:27:0:
/usr/include/mtd/ubi-user.h:330:3: error: conflicting types for ‘__packed’
/usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here
/usr/include/mtd/ubi-user.h:372:3: error: conflicting types for ‘__packed’
/usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here
...

But this kind of change is suggested by checkpatch.pl:
  WARN("__packed is preferred over __attribute__((packed))\n

One possible solution would be to let the "scripts/headers_install.pl"
script automatically substitute __packed with __attribute__((packed)):

diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index efb3be1..e0dc065 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -35,6 +35,7 @@ foreach my $file (@files) {
 		$line =~ s/([\s(])__iomem\s/$1/g;
 		$line =~ s/\s__attribute_const__\s/ /g;
 		$line =~ s/\s__attribute_const__$//g;
+		$line =~ s/\s__packed/__attribute__((packed))/g;
 		$line =~ s/^#include <linux\/compiler.h>//;
 		$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
 		$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;

Any thoughts?

-- 
Markus

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-06-30 21:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22  6:34 __packed vs. __attribute__((packed)) in kernel headers Markus Trippelsdorf
2011-06-23 13:42 ` Nick Bowler
2011-06-23 15:02   ` Markus Trippelsdorf
2011-06-23 16:57     ` Joe Perches
2011-06-24 13:07       ` Michal Marek
2011-06-24 13:51         ` {PATCH] fix __packed in exported " Markus Trippelsdorf
2011-06-24 15:17           ` Michal Marek
2011-06-24 16:33           ` Arnd Bergmann
2011-06-24 17:00             ` Mike Frysinger
2011-06-30 18:26               ` H. Peter Anvin
2011-06-30 18:48                 ` Mike Frysinger
2011-06-30 18:52                   ` H. Peter Anvin
2011-06-30 18:58                     ` Mike Frysinger
2011-06-30 19:01                       ` H. Peter Anvin
2011-06-30 19:13                         ` Mike Frysinger
2011-06-30 20:02                           ` H. Peter Anvin
2011-06-30 21:56                             ` Mike Frysinger
2011-06-24 17:01             ` Markus Trippelsdorf
2011-06-23 17:04 ` __packed vs. __attribute__((packed)) in " richard -rw- weinberger
2011-06-23 17:46   ` Markus Trippelsdorf
2011-06-23 17:54 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox