aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-02-26 14:39:01 -0700
committerTom Tromey <tromey@adacore.com>2019-03-05 08:48:39 -0700
commit18cb7c9f3add62ff598f0551a767af8aaa04b07e (patch)
tree81fa217c13e517539762f3d2d0bd8a19bc3edbc4 /gdb/common
parent093f70ccd3d8366de1faae3335bbe2eebd2a75d4 (diff)
downloadgdb-18cb7c9f3add62ff598f0551a767af8aaa04b07e.zip
gdb-18cb7c9f3add62ff598f0551a767af8aaa04b07e.tar.gz
gdb-18cb7c9f3add62ff598f0551a767af8aaa04b07e.tar.bz2
Introduce ATTRIBUTE_UNUSED_RESULT and use it
This introduces the new ATTRIBUTE_UNUSED_RESULT define, and applies it to gdb_argv::release. gdb/ChangeLog 2019-03-05 Tom Tromey <tromey@adacore.com> * utils.h (class gdb_argv) <release>: Add ATTRIBUTE_UNUSED_RESULT. * common/common-defs.h (ATTRIBUTE_UNUSED_RESULT): Define.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/common-defs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 732693d..6b1f004 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -93,6 +93,12 @@
#undef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF _GL_ATTRIBUTE_FORMAT_PRINTF
+#if GCC_VERSION >= 3004
+#define ATTRIBUTE_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
+#else
+#define ATTRIBUTE_UNUSED_RESULT
+#endif
+
#include "libiberty.h"
#include "pathmax.h"
#include "gdb/signals.h"