Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Luis Machado (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: gdb-patches@sourceware.org
Subject: [review] Fix use of non-existent DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
Date: Thu, 12 Dec 2019 13:03:00 -0000	[thread overview]
Message-ID: <gerrit.1576155779000.Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1576155779000.Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c@gnutoolchain-gerrit.osci.io>

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(-)



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

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c
Gerrit-Change-Number: 754
Gerrit-PatchSet: 1
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-MessageType: newchange


       reply	other threads:[~2019-12-12 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 13:03 Luis Machado (Code Review) [this message]
2019-12-12 13:03 ` [review v2] " Luis Machado (Code Review)
2019-12-12 16:22 ` Luis Machado (Code Review)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gerrit.1576155779000.Ifabf1fdb1bbafe55541ae2a93111eef8ec9bf52c@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox