]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
clang: don't define nocall
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 29 May 2020 15:52:06 +0000 (17:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 29 May 2020 15:52:06 +0000 (17:52 +0200)
Clang doesn't support attribute error, and the possible equivalents
like diagnose_if don't seem to work well in this case as they trigger
when when the function is not called (just by being used by the
APPEND_CALL macro).

Define nocall to a noop on clang until a proper solution can be found.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
[jb: error -> __error__]
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/compiler.h

index c22439b7a422e825466ac6cac566c651e0c7f271..c0e0ee9f27be1807bb2112576c68f36ae04e7753 100644 (file)
 
 #define __weak        __attribute__((__weak__))
 
-#define nocall        __attribute__((error("Nonstandard ABI")))
+#if !defined(__clang__)
+# define nocall       __attribute__((__error__("Nonstandard ABI")))
+#else
+# define nocall
+#endif
 
 #if (!defined(__clang__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5))
 #define unreachable() do {} while (1)