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