From a6980b7b585137e89145875d2149c682800d290f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 15 Apr 2013 20:40:21 +0100 Subject: [PATCH 07/11] Add _DBUS_GNUC_WARN_UNUSED_RESULT, similar to GLib's --- dbus/dbus-macros.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h index dcd3eeb..cae4100 100644 --- a/dbus/dbus-macros.h +++ b/dbus/dbus-macros.h @@ -88,13 +88,21 @@ #define DBUS_ALLOC_SIZE2(x,y) #endif +#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#define _DBUS_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define _DBUS_GNUC_WARN_UNUSED_RESULT +#endif + /** @def _DBUS_GNUC_PRINTF * used to tell gcc about printf format strings */ /** @def _DBUS_GNUC_NORETURN * used to tell gcc about functions that never return, such as _dbus_abort() */ - +/** @def _DBUS_GNUC_WARN_UNUSED_RESULT + * used to tell gcc about functions whose result must be used + */ /* Normally docs are in .c files, but there isn't a .c file for this. */ /** -- 1.7.10.4