From 18cb7c9f3add62ff598f0551a767af8aaa04b07e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 26 Feb 2019 14:39:01 -0700 Subject: 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 * utils.h (class gdb_argv) : Add ATTRIBUTE_UNUSED_RESULT. * common/common-defs.h (ATTRIBUTE_UNUSED_RESULT): Define. --- gdb/common/common-defs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/common') 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" -- cgit v1.1