From: Ben Pfaff Date: Mon, 21 Dec 2009 04:00:47 +0000 (-0800) Subject: Add new SENTINEL macro to compiler.h, for GCC's __attribute__((sentinel)). X-Git-Tag: fc11-x64-build67~2 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=845f87804138053543fafe97994d18c78e65be23;p=pspp-builds.git Add new SENTINEL macro to compiler.h, for GCC's __attribute__((sentinel)). --- 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 */