From 845f87804138053543fafe97994d18c78e65be23 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 20 Dec 2009 20:00:47 -0800 Subject: [PATCH] Add new SENTINEL macro to compiler.h, for GCC's __attribute__((sentinel)). --- src/libpspp/compiler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libpspp/compiler.h b/src/libpspp/compiler.h index d2281944..d8b29e96 100644 --- a/src/libpspp/compiler.h +++ b/src/libpspp/compiler.h @@ -77,4 +77,14 @@ #define PURE_FUNCTION #endif +/* This attribute indicates that the argument with the given + IDX must be a null pointer. IDX counts backward in the + argument list, so that 0 is the last argument, 1 is the + second-from-last argument, and so on. */ +#if __GNUC__ > 3 +#define SENTINEL(IDX) ATTRIBUTE ((sentinel(IDX))) +#else +#define SENTINEL +#endif + #endif /* compiler.h */ -- 2.30.2