Skip to content
Snippets Groups Projects
Commit 7ea50d52 authored by Jeroen Hofstee's avatar Jeroen Hofstee Committed by Tom Rini
Browse files

compiler_gcc: do not redefine __gnu_attributes


gcc allows extensions to be non compiler specific by defining
__* macros for the attributes supported by gcc. Having a
different definition causes many warnings during the build
(cdefs.h on FreeBSD uses __attribute((__pure__)) where u-boot
uses __attribute__((pure)) for example). Do not redefine
these macros to suppress these warnings.

This patch ignores the checkpatch warning:
WARNING: __packed is preferred over __attribute__((packed))

Signed-off-by: default avatarJeroen Hofstee <jeroen@myspectrum.nl>
parent dc19ec11
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
#endif #endif
#define __deprecated __attribute__((deprecated)) #define __deprecated __attribute__((deprecated))
#define __packed __attribute__((packed)) #ifndef __packed
# define __packed __attribute__((packed))
#endif
#define __weak __attribute__((weak)) #define __weak __attribute__((weak))
/* /*
...@@ -73,8 +75,12 @@ ...@@ -73,8 +75,12 @@
* would be. * would be.
* [...] * [...]
*/ */
#define __pure __attribute__((pure)) #ifndef __pure
#define __aligned(x) __attribute__((aligned(x))) # define __pure __attribute__((pure))
#endif
#ifndef __aligned
# define __aligned(x) __attribute__((aligned(x)))
#endif
#define __printf(a,b) __attribute__((format(printf,a,b))) #define __printf(a,b) __attribute__((format(printf,a,b)))
#define noinline __attribute__((noinline)) #define noinline __attribute__((noinline))
#define __attribute_const__ __attribute__((__const__)) #define __attribute_const__ __attribute__((__const__))
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
#define __used __attribute__((__used__)) #define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result)) #define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
#define __always_inline inline __attribute__((always_inline)) #ifndef __always_inline
# define __always_inline inline __attribute__((always_inline))
#endif
/* /*
* A trick to suppress uninitialized variable warning without generating any * A trick to suppress uninitialized variable warning without generating any
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment