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: sav-api~449 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=845f87804138053543fafe97994d18c78e65be23;p=pspp 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 d22819446f..d8b29e9689 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 */