Fix an "'__sentinel__' attribute directive ignored" warning
PATCH 1/5 Fix an "'__sentinel__' attribute directive ignored" warning
This attribute was introduced in gcc 3.5. My Cygwin install, which is not that old, is using gcc 3.4.4.
Signed-off-by Ramsay Jones <[email protected]>
--- lib.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
lib.h +6 -0
@@ -68,10 +68,16 @@ typedef struct pseudo *pseudo_t;struct token *skip_to (struct token *,int );struct token *expect (struct token *,int ,const char *);#ifdef __GNUC__ +#define GCC_VERSION (__GNUC__ * 1000 + __GNUC__MINOR__)#define FORMAT_ATTR (pos) __attribute__ ((__format__ (__printf__, pos, pos+1)))#define NORETURN_ATTR __attribute__ ((__noreturn__)) +/* __sentinel__ attribute was introduced in gcc 3.5 */ +#if (GCC_VERSION >=3005 )#define SENTINEL_ATTR __attribute__ ((__sentinel__))#else +#define SENTINEL_ATTR +#endif /* gcc >= 3.5 */ +#else #define FORMAT_ATTR (pos)#define NORETURN_ATTR #define SENTINEL_ATTR
Signature · 1 line
1.5.1