From c51a167cb758aa378e27a9065b1641f758b11cac Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 7 Sep 2009 11:16:16 +0300 Subject: Add RPM_GNUC_NONNULL macro for portable use of gcc nonnull attribute - gcc itself can only warn on literal NULL's passed where nonnull is expected but static analyzers can make better use of the info --- rpmio/rpmutil.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rpmio') diff --git a/rpmio/rpmutil.h b/rpmio/rpmutil.h index 19a7a9c23..746dae576 100644 --- a/rpmio/rpmutil.h +++ b/rpmio/rpmutil.h @@ -71,9 +71,12 @@ #endif /* __GNUC__ */ #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) -# define RPM_GNUC_MAY_ALIAS __attribute__((may_alias)) +#define RPM_GNUC_MAY_ALIAS __attribute__((may_alias)) +#define RPM_GNUC_NONNULL( ... ) \ + __attribute__((__nonnull__ (__VA_ARGS__))) #else -# define RPM_GNUC_MAY_ALIAS +#define RPM_GNUC_MAY_ALIAS +#define RPM_GNUC_NONNULL( ... ) #endif #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -- cgit v1.2.3