[review] Fix use of non-existent DIAGNOSTIC_IGNORE_UNUSED_FUNCTION

Message ID gerrit.1576155779000.Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c@gnutoolchain-gerrit.osci.io
State New, archived
Headers

Commit Message

Simon Marchi (Code Review) Dec. 12, 2019, 1:03 p.m. UTC
  Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/754
......................................................................

Fix use of non-existent DIAGNOSTIC_IGNORE_UNUSED_FUNCTION

A previous commit removed DIAGNOSTIC_IGNORE_UNUSED_FUNCTION because it is
known not to work correctly for some older versions of GCC.

2019-12-12  Luis Machado  <luis.machado@linaro.org>

	* gdbsupport/thread-pool.c (set_thread_name): Add ATTRIBUTE_UNUSED
	to both functions.
	Remove use of DIAGNOSTIC PUSH/POP and DIAGNOSTIC_IGNORE_UNUSED_FUNCTION.

Change-Id: Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c
---
M gdb/gdbsupport/thread-pool.c
1 file changed, 2 insertions(+), 7 deletions(-)
  

Comments

Simon Marchi (Code Review) Dec. 12, 2019, 4:21 p.m. UTC | #1
Luis Machado has abandoned this change. ( https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/754 )

Change subject: Fix use of non-existent DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
......................................................................


Abandoned

Abanboning due to another commit being pushed.
  

Patch

diff --git a/gdb/gdbsupport/thread-pool.c b/gdb/gdbsupport/thread-pool.c
index f6ea6d8..1f96c16 100644
--- a/gdb/gdbsupport/thread-pool.c
+++ b/gdb/gdbsupport/thread-pool.c
@@ -40,27 +40,22 @@ 
 
 #include <pthread.h>
 
-DIAGNOSTIC_PUSH
-DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
-
 /* Handle platform discrepancies in pthread_setname_np: macOS uses a
    single-argument form, while Linux uses a two-argument form.  This
    wrapper handles the difference.  */
 
-static void
+ATTRIBUTE_UNUSED static void
 set_thread_name (int (*set_name) (pthread_t, const char *), const char *name)
 {
   set_name (pthread_self (), name);
 }
 
-static void
+ATTRIBUTE_UNUSED static void
 set_thread_name (void (*set_name) (const char *), const char *name)
 {
   set_name (name);
 }
 
-DIAGNOSTIC_POP
-
 #endif	/* USE_PTHREAD_SETNAME_NP */
 
 namespace gdb