[lxc-devel] [lxc/master] compiler: fix __noreturn on bionic

brauner on Github lxc-bot at linuxcontainers.org
Wed Sep 26 12:40:01 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180926/34461ed0/attachment.bin>
-------------- next part --------------
From d17947f8f3f26f435e601c0af4753418eee9cfef Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 26 Sep 2018 14:38:41 +0200
Subject: [PATCH] compiler: fix __noreturn on bionic

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/compiler.h | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/lxc/compiler.h b/src/lxc/compiler.h
index 76a7b733d..59ad802da 100644
--- a/src/lxc/compiler.h
+++ b/src/lxc/compiler.h
@@ -20,6 +20,8 @@
 #ifndef __LXC_COMPILER_H
 #define __LXC_COMPILER_H
 
+#include <sys/cdefs.h>
+
 #include "config.h"
 
 #ifndef thread_local
@@ -38,12 +40,18 @@
 #define __fallthrough
 #endif
 
-#ifndef _noreturn_
-#if __STDC_VERSION__ >= 201112L && !IS_BIONIC
-#define __noreturn _Noreturn
-#else
-#define __noreturn __attribute__((noreturn))
-#endif
+#ifndef __noreturn
+#	if __STDC_VERSION__ >= 201112L
+#		if !IS_BIONIC
+#			define __noreturn _Noreturn
+#		else
+#			define __noreturn __attribute__((__noreturn__))
+#		endif
+#	elif IS_BIONIC
+#		define __noreturn __attribute__((__noreturn__))
+#	else
+#		define __noreturn __attribute__((noreturn))
+#	endif
 #endif
 
 #define __cgfsng_ops


More information about the lxc-devel mailing list