Message ID | 8b99d666e78ba5b9d32c7889a2161c70b3da88df.1666257885.git.research_trasio@irq.a4lg.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp153078wrs; Thu, 20 Oct 2022 02:27:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4z37bLt7rSV9EQN/4ZBLXWfx+ZEkcWlZPzNubpeS98p9nQMdytUWkJIQDlUgskXGPuYOBF X-Received: by 2002:a05:6402:4441:b0:454:8a74:5459 with SMTP id o1-20020a056402444100b004548a745459mr11115327edb.155.1666258023137; Thu, 20 Oct 2022 02:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666258023; cv=none; d=google.com; s=arc-20160816; b=ypDUf77G92NlgorhlGm1sWWMlMD94I3FIb6U3+cU8J79641GYHik2VPqeLgaYitTjZ d+aYFYLGL/N5JeL/AKMIo1v7F/1cKoVsG2pOsyhliQcslOuuKzH4GcFpU+iGkTK1T4u/ MyMblXj/M1TJPXrFH4qVT9XpPCQr56jhojUlZbTFG/RAzqWPA/eyvMry6CjUJxqWDTNS OUbGAlTEYzNE6u36m+CSdarh48XOLOicY5DqIPUy62mHGJTEyoON39i7Eosgn6LY2S/z FnO8whl1rh7Run+1+fkuot+jeKQKVLR7WV4srrPbUsV/ghhxaF7zXKG6K7I/txyw5GUh gPkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=N64IVYqRs1KZ0jngodYFomJBw/rxpI0DP8JOnKm7jmI=; b=m80cjYJElZW5ppO3zq5qs+Eg+gumvo+VLD7S47GdXaTefsNVxopLaudi9fjuJPwrqy 0qJhFMgxwR154ywnrgJ8ke1Fy8cQGFkvy/7REIVG6feyfPm4WGct6eyZr2zO63LSx4WV 5FIe5h5slusZHXUrTZpOCwDovAHwKMCyQZ9nqbdPesvxbItbxkNHuRaSc3ZO8q+ftYf0 FAJs2zSwwt7YM6myFQNR5c+7qNLldrm+lsAaP3LWr77oBucfgEB/L4Kwp3o6nKwJ21pn 5TOkS1goylFJxKvo3mywpErkDzuKveZ/l5qV9BRgJWCov4GKhBdW3+qe9j0cjSNoxApM 5soA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=F5el3Ce0; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l18-20020a1709067d5200b0078aefaf3910si15000938ejp.362.2022.10.20.02.27.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:27:03 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=F5el3Ce0; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 562C73860757 for <ouuuleilei@gmail.com>; Thu, 20 Oct 2022 09:26:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 562C73860757 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258017; bh=N64IVYqRs1KZ0jngodYFomJBw/rxpI0DP8JOnKm7jmI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=F5el3Ce0TIvmPmKz1nOpnSiWKGt7UIC9UUTner4kO1+Kw/fF0UWJJRDYxhWAIMXMK WP0fnw0xBHynTzMQ7oXsZ+sOTYqLBzaIALBMF2zu2rsC9jmP/aGR2DSr+jPXEhzHG5 TQKOoZ+8IeEiLOOdoYz3JwLFEvJChQ9kHGuTDR5g= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 2852538515D3 for <binutils@sourceware.org>; Thu, 20 Oct 2022 09:26:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2852538515D3 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 7CE00300089; Thu, 20 Oct 2022 09:26:47 +0000 (UTC) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Mike Frysinger <vapier@gentoo.org>, Nick Clifton <nickc@redhat.com> Subject: [PATCH 01/40] gdb/unittests: PR28413, suppress warnings generated by Gnulib Date: Thu, 20 Oct 2022 09:25:47 +0000 Message-Id: <8b99d666e78ba5b9d32c7889a2161c70b3da88df.1666257885.git.research_trasio@irq.a4lg.com> In-Reply-To: <cover.1666257885.git.research_trasio@irq.a4lg.com> References: <cover.1666257885.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Binutils <binutils@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: binutils@sourceware.org Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747198172768090751?= X-GMAIL-MSGID: =?utf-8?q?1747198172768090751?= |
Series |
sim+gdb: Suppress warnings if built with Clang (big batch 1)
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Tsukasa OI
Oct. 20, 2022, 9:25 a.m. UTC
Gnulib generates a warning if the system version of certain functions are used (to redirect the developer to use Gnulib version). It caused a compiler error when... - Compiled with Clang - -Werror is specified (by default) - C++ standard used by Clang is before C++17 (by default as of 15.0.0) when this unit test is activated. This issue is raised as PR28413. However, previous proposal to fix this issue (a "fix" to Gnulib): <https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00003.html> was rejected because it ruins the intent of Gnulib warnings. So, we need a Binutils/GDB-side solution. This commit tries to address this issue on the GDB side. We have "include/diagnostics.h" to disable certain warnings only when necessary. This commit suppresses the Gnulib warnings by surrounding entire #include block with DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS to disable Gnulib- generated warnings on all standard C++ header files. --- gdb/unittests/string_view-selftests.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/gdb/unittests/string_view-selftests.c b/gdb/unittests/string_view-selftests.c index 2d7261d18d3..441d533b54e 100644 --- a/gdb/unittests/string_view-selftests.c +++ b/gdb/unittests/string_view-selftests.c @@ -23,6 +23,11 @@ #define GNULIB_NAMESPACE gnulib +#include "diagnostics.h" + +DIAGNOSTIC_PUSH +DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS + #include "defs.h" #include "gdbsupport/selftest.h" #include "gdbsupport/gdb_string_view.h" @@ -34,6 +39,8 @@ #include <fstream> #include <iostream> +DIAGNOSTIC_POP + /* libstdc++'s testsuite uses VERIFY. */ #define VERIFY SELF_CHECK