From: Ben Pfaff Date: Mon, 8 May 2006 00:10:21 +0000 (+0000) Subject: New macro WARN_UNUSED_RESULT. X-Git-Tag: v0.6.0~872 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=028d89f9437e8fb25fd3fd67bcdd158819ce8557;p=pspp-builds.git New macro WARN_UNUSED_RESULT. --- diff --git a/src/libpspp/ChangeLog b/src/libpspp/ChangeLog index ca11f306..31097a10 100644 --- a/src/libpspp/ChangeLog +++ b/src/libpspp/ChangeLog @@ -1,3 +1,7 @@ +Sun May 7 17:09:54 2006 Ben Pfaff + + * compiler.h: (macro WARN_UNUSED_RESULT) New macro. + Sun May 7 14:32:25 2006 Ben Pfaff * va_copy.h: New header. diff --git a/src/libpspp/compiler.h b/src/libpspp/compiler.h index 44f22b39..8c2c3abd 100644 --- a/src/libpspp/compiler.h +++ b/src/libpspp/compiler.h @@ -44,4 +44,11 @@ #define MALLOC_LIKE #endif +/* This attribute was added in GCC 4.0. */ +#if __GNUC__ >= 4 +#define WARN_UNUSED_RESULT ATTRIBUTE ((warn_unused_result)) +#else +#define WARN_UNUSED_RESULT +#endif + #endif /* compiler.h */