From 1452d8164d4bd9e88a507756642fea5e0180f015 Mon Sep 17 00:00:00 2001 From: mrdudz <mrdudz@users.noreply.github.com> Date: Sat, 5 Nov 2022 20:37:41 +0100 Subject: [PATCH] add ATTR_UNUSED and ATTR_NORETURN --- src/common/attrib.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/attrib.h b/src/common/attrib.h index 07e08b2df..a7935d919 100644 --- a/src/common/attrib.h +++ b/src/common/attrib.h @@ -44,14 +44,20 @@ -#if defined(__GNUC__) -# define attribute(a) __attribute__(a) +#ifdef __clang__ +# define attribute(a) __attribute__(a) +# define ATTR_UNUSED(x) +# define ATTR_NORETURN __attribute__((analyzer_noreturn)) +#elif defined(__GNUC__) +# define attribute(a) __attribute__(a) +# define ATTR_UNUSED(x) __attribute__((__unused__)) x +# define ATTR_NORETURN __attribute__((noreturn)) #else # define attribute(a) +# define ATTR_UNUSED(x) +# define ATTR_NORETURN #endif - - /* End of attrib.h */ #endif