Add _DBUS_GNUC_WARN_UNUSED_RESULT, similar to GLib's
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 15 Apr 2013 19:40:21 +0000 (20:40 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 8 May 2013 13:34:16 +0000 (14:34 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
dbus/dbus-macros.h

index dcd3eeb..cae4100 100644 (file)
 #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. */
 /**