From cb51113052d534b628c635ac7b86b95fe436d60d Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Tue, 10 Dec 2019 13:42:40 -0600 Subject: [PATCH] Suppress the "unused function" warning for select_strerror_r 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 * gdbsupport/safe-strerror.c: Supress the unused function warning for select_strerror_r. Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169 --- gdb/ChangeLog | 5 +++++ gdb/gdbsupport/safe-strerror.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a6e299d9053..c4e8109b7c5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-12-10 Christian Biesinger + + * gdbsupport/safe-strerror.c: Supress the unused function warning + for select_strerror_r. + 2019-12-10 Christian Biesinger * config.in: Regenerate. diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c index 7425af590f7..9973fa67857 100644 --- a/gdb/gdbsupport/safe-strerror.c +++ b/gdb/gdbsupport/safe-strerror.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "common-defs.h" +#include "diagnostics.h" #include /* 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.30.2