All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [2.6 patch] add compiler-gcc4.h
Date: Sun, 6 Feb 2005 01:50:56 +0100	[thread overview]
Message-ID: <20050206005056.GN3129@stusta.de> (raw)
In-Reply-To: <420523E0.9090603@zytor.com>

On Sat, Feb 05, 2005 at 11:52:00AM -0800, H. Peter Anvin wrote:
> Adrian Bunk wrote:
> >
> >It doesn't seem to be logical for everyone whether compiler-gcc+.h or 
> >compiler-gcc3.h is used for gcc 4.0 ...
> >
> >Perhaps compiler-gcc+.h (which wasn't always updated when 
> >compiler-gcc3.h was updated) should be removed?
> >
> 
> That would make more sense.  After all, gcc5+ can use the gcc4 file 
> until a gcc5 file proper is created.

The compiler-gcc*.h files check only for __GNUC_MINOR__ but not for 
__GNUC__ .

Is the patch below OK?

> 	-hpa

cu
Adrian


<--  snip  -->

With the release of gcc 4.0 being only a few months away and people 
already tring compiling with it, it's time for adding a compiler-gcc4.h .

This patch contains the following changes:
- remove compiler-gcc+.h
- compiler-gcc4.h: new file based on a corrected compiler-gcc+.h
- compiler.h: include compiler-gcc4.h for gcc 4
- compiler.h: #error for gcc > 4
- compiler-gcc3.h: remove __compiler_offsetof (there will never be a
                                               gcc 3.5)
                   small indention corrections

I've tested the compilation with both gcc 3.4.4 and a recent gcc 4.0 
snapshot from Debian experimental.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 include/linux/compiler-gcc+.h |    3 +++
 include/linux/compiler-gcc3.h |   10 ++++------
 include/linux/compiler-gcc4.h |   16 ++++++++++++++++
 include/linux/compiler.h      |    6 ++++--
 4 files changed, 27 insertions(+), 8 deletions(-)

--- linux-2.6.11-rc2-mm2-full/include/linux/compiler.h.old	2005-01-30 09:59:28.000000000 +0100
+++ linux-2.6.11-rc2-mm2-full/include/linux/compiler.h	2005-01-30 10:00:15.000000000 +0100
@@ -34,8 +34,10 @@
 
 #ifdef __KERNEL__
 
-#if __GNUC__ > 3
-# include <linux/compiler-gcc+.h>	/* catch-all for GCC 4, 5, etc. */
+#if __GNUC__ > 4
+#error no compiler-gcc.h file for this gcc version
+#elif __GNUC__ == 4
+# include <linux/compiler-gcc4.h>
 #elif __GNUC__ == 3
 # include <linux/compiler-gcc3.h>
 #elif __GNUC__ == 2
--- linux-2.6.11-rc2-mm2-full/include/linux/compiler-gcc3.h.old	2005-01-30 10:05:16.000000000 +0100
+++ linux-2.6.11-rc2-mm2-full/include/linux/compiler-gcc3.h	2005-01-30 10:08:38.000000000 +0100
@@ -10,7 +10,7 @@
 #endif
 
 #if __GNUC_MINOR__ > 0
-# define __deprecated	__attribute__((deprecated))
+# define __deprecated		__attribute__((deprecated))
 #endif
 
 #if __GNUC_MINOR__ >= 3
@@ -23,12 +23,10 @@
 #define __attribute_const__	__attribute__((__const__))
 
 #if __GNUC_MINOR__ >= 1
-#define  noinline __attribute__((noinline))
+#define  noinline		__attribute__((noinline))
 #endif
+
 #if __GNUC_MINOR__ >= 4
-#define __must_check __attribute__((warn_unused_result))
+#define __must_check		__attribute__((warn_unused_result))
 #endif
 
-#if __GNUC_MINOR__ >= 5
-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
-#endif
--- /dev/null	2004-11-25 03:16:25.000000000 +0100
+++ linux-2.6.11-rc2-mm2-full/include/linux/compiler-gcc4.h	2005-01-30 10:09:08.000000000 +0100
@@ -0,0 +1,16 @@
+/* Never include this file directly.  Include <linux/compiler.h> instead.  */
+
+/* These definitions are for GCC v4.x.  */
+#include <linux/compiler-gcc.h>
+
+#define inline			inline		__attribute__((always_inline))
+#define __inline__		__inline__	__attribute__((always_inline))
+#define __inline		__inline	__attribute__((always_inline))
+#define __deprecated		__attribute__((deprecated))
+#define __attribute_used__	__attribute__((__used__))
+#define __attribute_pure__	__attribute__((pure))
+#define __attribute_const__	__attribute__((__const__))
+#define  noinline		__attribute__((noinline))
+#define __must_check 		__attribute__((warn_unused_result))
+#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
+
--- linux-2.6.11-rc3-mm1-full/include/linux/compiler-gcc+.h	2004-12-24 22:35:39.000000000 +0100
+++ /dev/null	2004-11-25 03:16:25.000000000 +0100
@@ -1,16 +0,0 @@
-/* Never include this file directly.  Include <linux/compiler.h> instead.  */
-
-/*
- * These definitions are for Ueber-GCC: always newer than the latest
- * version and hence sporting everything plus a kitchen-sink.
- */
-#include <linux/compiler-gcc.h>
-
-#define inline			inline		__attribute__((always_inline))
-#define __inline__		__inline__	__attribute__((always_inline))
-#define __inline		__inline	__attribute__((always_inline))
-#define __deprecated		__attribute__((deprecated))
-#define __attribute_used__	__attribute__((__used__))
-#define __attribute_pure__	__attribute__((pure))
-#define __attribute_const__	__attribute__((__const__))
-#define __must_check 		__attribute__((warn_unused_result))


      parent reply	other threads:[~2005-02-06  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-30 13:03 [2.6 patch] add compiler-gcc4.h Adrian Bunk
2005-01-30 14:11 ` Andi Kleen
2005-01-30 14:14   ` Adrian Bunk
2005-01-30 15:35   ` Matthias-Christian Ott
2005-02-03  1:04     ` H. Peter Anvin
2005-02-05 13:50       ` Adrian Bunk
2005-02-05 18:45         ` H. Peter Anvin
2005-02-05 19:38           ` Adrian Bunk
2005-02-05 19:52             ` H. Peter Anvin
2005-02-06  0:43               ` [RFC][PATCH-2.6] Clean up and merge compiler-*.h Kyle Moffett
2005-02-06  0:50               ` Adrian Bunk [this message]

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=20050206005056.GN3129@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=hpa@zytor.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.