public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r
@ 2019-12-10 19:45 Christian Biesinger via gdb-patches
  2019-12-11 13:56 ` Luis Machado
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-10 19:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christian Biesinger

We only ever use one of the two overloads, so to avoid breaking -Werror
builds, supress the warning.

gdb/ChangeLog:

2019-12-10  Christian Biesinger  <cbiesinger@google.com>

	* gdbsupport/safe-strerror.c: Supress the unused function warning
	for select_strerror_r.

Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169
---
 gdb/gdbsupport/safe-strerror.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
index 7425af590f..9973fa6785 100644
--- a/gdb/gdbsupport/safe-strerror.c
+++ b/gdb/gdbsupport/safe-strerror.c
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "common-defs.h"
+#include "diagnostics.h"
 #include <string.h>
 
 /* There are two different versions of strerror_r; one is GNU-specific, the
@@ -26,6 +27,11 @@
    to solve this for us because IPA does not use Gnulib but uses this
    function.  */
 
+/* We only ever use one of the two overloads, so suppress the warning for
+   an unused function.  */
+DIAGNOSTIC_PUSH
+DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
+
 /* Called if we have a XSI-compliant strerror_r.  */
 static char *
 select_strerror_r (int res, char *buf)
@@ -40,6 +46,8 @@ select_strerror_r (char *res, char *)
   return res;
 }
 
+DIAGNOSTIC_POP
+
 /* Implementation of safe_strerror as defined in common-utils.h.  */
 
 const char *
-- 
2.24.0.525.g8f36a354ae-goog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r
  2019-12-10 19:45 [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r Christian Biesinger via gdb-patches
@ 2019-12-11 13:56 ` Luis Machado
  2019-12-11 15:55   ` Christian Biesinger via gdb-patches
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2019-12-11 13:56 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches

Hi,

I'm still running into this, even with the pushed fix. I'm running 
Ubuntu 18.04.3.

On 12/10/19 4:45 PM, Christian Biesinger via gdb-patches wrote:
> We only ever use one of the two overloads, so to avoid breaking -Werror
> builds, supress the warning.
> 
> gdb/ChangeLog:
> 
> 2019-12-10  Christian Biesinger  <cbiesinger@google.com>
> 
> 	* gdbsupport/safe-strerror.c: Supress the unused function warning
> 	for select_strerror_r.
> 
> Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169
> ---
>   gdb/gdbsupport/safe-strerror.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
> index 7425af590f..9973fa6785 100644
> --- a/gdb/gdbsupport/safe-strerror.c
> +++ b/gdb/gdbsupport/safe-strerror.c
> @@ -18,6 +18,7 @@
>      along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>   
>   #include "common-defs.h"
> +#include "diagnostics.h"
>   #include <string.h>
>   
>   /* There are two different versions of strerror_r; one is GNU-specific, the
> @@ -26,6 +27,11 @@
>      to solve this for us because IPA does not use Gnulib but uses this
>      function.  */
>   
> +/* We only ever use one of the two overloads, so suppress the warning for
> +   an unused function.  */
> +DIAGNOSTIC_PUSH
> +DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
> +
>   /* Called if we have a XSI-compliant strerror_r.  */
>   static char *
>   select_strerror_r (int res, char *buf)
> @@ -40,6 +46,8 @@ select_strerror_r (char *res, char *)
>     return res;
>   }
>   
> +DIAGNOSTIC_POP
> +
>   /* Implementation of safe_strerror as defined in common-utils.h.  */
>   
>   const char *
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r
  2019-12-11 13:56 ` Luis Machado
@ 2019-12-11 15:55   ` Christian Biesinger via gdb-patches
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-11 15:55 UTC (permalink / raw)
  To: Luis Machado; +Cc: gdb-patches

On Wed, Dec 11, 2019 at 8:56 AM Luis Machado <luis.machado@linaro.org> wrote:
>
> Hi,
>
> I'm still running into this, even with the pushed fix. I'm running
> Ubuntu 18.04.3.

For those following along, Luis uploaded a fix:
https://sourceware.org/ml/gdb-patches/2019-12/msg00413.html

> On 12/10/19 4:45 PM, Christian Biesinger via gdb-patches wrote:
> > We only ever use one of the two overloads, so to avoid breaking -Werror
> > builds, supress the warning.
> >
> > gdb/ChangeLog:
> >
> > 2019-12-10  Christian Biesinger  <cbiesinger@google.com>
> >
> >       * gdbsupport/safe-strerror.c: Supress the unused function warning
> >       for select_strerror_r.
> >
> > Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169
> > ---
> >   gdb/gdbsupport/safe-strerror.c | 8 ++++++++
> >   1 file changed, 8 insertions(+)
> >
> > diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
> > index 7425af590f..9973fa6785 100644
> > --- a/gdb/gdbsupport/safe-strerror.c
> > +++ b/gdb/gdbsupport/safe-strerror.c
> > @@ -18,6 +18,7 @@
> >      along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> >
> >   #include "common-defs.h"
> > +#include "diagnostics.h"
> >   #include <string.h>
> >
> >   /* There are two different versions of strerror_r; one is GNU-specific, the
> > @@ -26,6 +27,11 @@
> >      to solve this for us because IPA does not use Gnulib but uses this
> >      function.  */
> >
> > +/* We only ever use one of the two overloads, so suppress the warning for
> > +   an unused function.  */
> > +DIAGNOSTIC_PUSH
> > +DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
> > +
> >   /* Called if we have a XSI-compliant strerror_r.  */
> >   static char *
> >   select_strerror_r (int res, char *buf)
> > @@ -40,6 +46,8 @@ select_strerror_r (char *res, char *)
> >     return res;
> >   }
> >
> > +DIAGNOSTIC_POP
> > +
> >   /* Implementation of safe_strerror as defined in common-utils.h.  */
> >
> >   const char *
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-11 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 19:45 [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r Christian Biesinger via gdb-patches
2019-12-11 13:56 ` Luis Machado
2019-12-11 15:55   ` Christian Biesinger via gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).