[PATCH 1/5] Fix an "'__sentinel__' attribute directive ignored" warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 <ramsay@xxxxxxxxxxxxxxxxxxx>
---
 lib.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib.h b/lib.h
index df9cfc4..6902f91 100644
--- a/lib.h
+++ b/lib.h
@@ -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
--
1.5.1


-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux