Suppress the "unused function" warning for select_strerror_r
authorChristian Biesinger <cbiesinger@google.com>
Tue, 10 Dec 2019 19:42:40 +0000 (13:42 -0600)
committerChristian Biesinger <cbiesinger@google.com>
Tue, 10 Dec 2019 19:44:21 +0000 (13:44 -0600)
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/ChangeLog
gdb/gdbsupport/safe-strerror.c

index a6e299d905311be670c093bc8b82b515cb1d2309..c4e8109b7c5b17debb738726e59fbb3cc074cc6e 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-10  Christian Biesinger  <cbiesinger@google.com>
+
+       * gdbsupport/safe-strerror.c: Supress the unused function warning
+       for select_strerror_r.
+
 2019-12-10  Christian Biesinger  <cbiesinger@google.com>
 
        * config.in: Regenerate.
index 7425af590f789c1625013c9dc51b505a324ad7fd..9973fa678577c3ff1d9188a6679a0c8cecfd5d26 100644 (file)
@@ -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
    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 *
This page took 0.0305879999999999 seconds and 4 git commands to generate.