All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/common: Uniformally use __ varients for attribute names
@ 2016-02-11 19:51 Andrew Cooper
  2016-02-12  9:16 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2016-02-11 19:51 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Tim Deegan, Ian Campbell, Jan Beulich

Otherwise, debug code such as "void __attribute__((noreturn)) foobar()" fails
to compile when the noreturn itself gets expanded, resulting in
__attribute__((__attribute__((noreturn)))).

No function change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Ian Campbell <Ian.Campbell@citrix.com>
---
 xen/include/xen/compiler.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 4b3472d..892455b 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -11,12 +11,12 @@
 #define unlikely(x)   __builtin_expect(!!(x),0)
 
 #define inline        __inline__
-#define always_inline __inline__ __attribute__ ((always_inline))
-#define noinline      __attribute__((noinline))
+#define always_inline __inline__ __attribute__ ((__always_inline__))
+#define noinline      __attribute__((__noinline__))
 
-#define noreturn      __attribute__((noreturn))
+#define noreturn      __attribute__((__noreturn__))
 
-#define __packed      __attribute__((packed))
+#define __packed      __attribute__((__packed__))
 
 #if (!defined(__clang__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5))
 #define unreachable() do {} while (1)
@@ -43,7 +43,7 @@
 #define __inline__ __inline__ __init
 #endif
 
-#define __attribute_pure__  __attribute__((pure))
+#define __attribute_pure__  __attribute__((__pure__))
 #define __attribute_const__ __attribute__((__const__))
 
 /*
@@ -60,7 +60,7 @@
 #define __used         __attribute__((__used__))
 #define __maybe_unused __attribute__((__unused__))
 
-#define __must_check __attribute__((warn_unused_result))
+#define __must_check __attribute__((__warn_unused_result__))
 
 #define offsetof(a,b) __builtin_offsetof(a,b)
 
-- 
2.1.4

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

* Re: [PATCH] xen/common: Uniformally use __ varients for attribute names
  2016-02-11 19:51 [PATCH] xen/common: Uniformally use __ varients for attribute names Andrew Cooper
@ 2016-02-12  9:16 ` Jan Beulich
  2016-02-12  9:56   ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2016-02-12  9:16 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Tim Deegan, Ian Campbell, Xen-devel

>>> On 11.02.16 at 20:51, <andrew.cooper3@citrix.com> wrote:
> Otherwise, debug code such as "void __attribute__((noreturn)) foobar()" fails
> to compile when the noreturn itself gets expanded, resulting in
> __attribute__((__attribute__((noreturn)))).

Well, why would the debugging code not use plain "noreturn" then,
instead of open coding its expansion? That notwithstanding the
patch is fine of course.

Jan

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

* Re: [PATCH] xen/common: Uniformally use __ varients for attribute names
  2016-02-12  9:16 ` Jan Beulich
@ 2016-02-12  9:56   ` Andrew Cooper
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2016-02-12  9:56 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Tim Deegan, Ian Campbell, Xen-devel

On 12/02/16 09:16, Jan Beulich wrote:
>>>> On 11.02.16 at 20:51, <andrew.cooper3@citrix.com> wrote:
>> Otherwise, debug code such as "void __attribute__((noreturn)) foobar()" fails
>> to compile when the noreturn itself gets expanded, resulting in
>> __attribute__((__attribute__((noreturn)))).
> Well, why would the debugging code not use plain "noreturn" then,
> instead of open coding its expansion? That notwithstanding the
> patch is fine of course.

Which one works depends on whether <xen/compiler.h> has been included. 
There are some translation units in Xen where this is not the case.

~Andrew

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

end of thread, other threads:[~2016-02-12  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 19:51 [PATCH] xen/common: Uniformally use __ varients for attribute names Andrew Cooper
2016-02-12  9:16 ` Jan Beulich
2016-02-12  9:56   ` Andrew Cooper

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.