From patchwork Tue Dec 10 19:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 36688 Received: (qmail 109446 invoked by alias); 10 Dec 2019 19:45:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 108494 invoked by uid 89); 10 Dec 2019 19:45:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:209.85.160 X-HELO: mail-qt1-f201.google.com Received: from mail-qt1-f201.google.com (HELO mail-qt1-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 19:45:05 +0000 Received: by mail-qt1-f201.google.com with SMTP id h14so2702352qtq.11 for ; Tue, 10 Dec 2019 11:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=4DPLrA/vnuemxybWYQfkrtKbTF6oQC2Z/8NXlugjSjU=; b=IKtaQHnS+im9GvQYwFdcs1w+NmMxePOcUTFj3Qx88XiZwK+AqbbyAEpqmp7U0gU3SB r4k26df1ElIbo9ZgixBa937RmWmzXm9oNWZVij1UUesf7t8RncW7rD86g7OVXQKgdoRA TRDjKk/RnUVgFkenFdaPsRemp6I2D9OTbtHD1qZFDAoMNqs83TglWEikIpFQAv9ITXOz WhBqA2IOXZZDML2vxOgYHtIazei3/DoOt9wBgnRmPY5NegqCtOpEZum6c2VEVeYZpALm ST9N6WATKtJpAHGTDHabQQDpRA1pffsvHCuQq92h46obtY8eYkhmNgYs5jS0iFUsD5Jp 9wHQ== Date: Tue, 10 Dec 2019 13:45:01 -0600 Message-Id: <20191210194501.45222-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [FYI/PUSHED] Suppress the "unused function" warning for select_strerror_r X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes 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/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 . */ #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 *