From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id AD27E3858C50 for ; Sun, 30 Apr 2023 23:19:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD27E3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1a814fe0ddeso19965005ad.2 for ; Sun, 30 Apr 2023 16:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682896765; x=1685488765; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=diI4oHA8d8FQseeMc7fyhtIbtne6ymBP/CDyKa6kgkU=; b=go/aOb9y28+lO/bM772rCGK93H9pBAB0CQGVbZa7m9oOthuKZNAVnJNY9pqSFVuNJQ 4jduKSkQEYwseJYtMmRRwkxyB19115TbdNN/cH7E8M6/AbJ+Ebn8Raz8NziUQ8FKEYo9 /rTnDqWniFsp+oR8VgvFjGHYl8bR2z/URFpZWWKcitpzb5GOI0rlRZ9fvKJJ+Kma3+Sg gTiZlfWhGbY8a0OOWDakppPEHbiudkLRnVJY0oW3plE2ATZsF8DnwakcdeSZX9K/dBbn caafnKa82nCplXVCmVsWHYDQwQuAmCVvyi0Tcyl1FYNoXXmUy6itGK6ZvLbChASxKYDV rOtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682896765; x=1685488765; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=diI4oHA8d8FQseeMc7fyhtIbtne6ymBP/CDyKa6kgkU=; b=EeZRSNWw3vuHH9CeF3C4mBxQ5brDOr/P1NGETd4XSf4FQ/HO+GVFaf08o5wU0IFZxD sgnUbR+0UAzhudR3mOoStUCf4ygHhK1161JW38wNfjV0bujLjeXiij5aRpenVzMdq3No im2MNbLMWttiv68QdMTDjc4r1zgVe4m8+LWUr6Nez6zhJOXvV10O8QEfUau2ezuM/kEo uPobm9IsRoY9D68Nj4oEA3AKG+tM84w8G23ttwjb4Az+CS2PFjgQPQmKVf0IFM4DR7jl gfkxEgVA1svJtIx2tkSnW60FGKnxhut2dYLTdfYVXrt9EYCcfUBdEDbPAGwActbTSP2+ 21CQ== X-Gm-Message-State: AC+VfDwRGk2jp6H5bdbtYIGAgHV4Beltf2lP6Kt1QYVYeoM4um7q8o7P VTMxoadH+Zd5ljKm5a6bJy2lbXVuYyVRb29R7Mo= X-Google-Smtp-Source: ACHHUZ7TST6UtFjf/kmCkasMMj9o9X3F/XAwim7zWIP+Bqm/VqW49xLnmb3IU2Ubfrh+S+x/eywMqSyFaqU5EHz/NM4= X-Received: by 2002:a17:902:f68b:b0:1a2:58f1:5e1d with SMTP id l11-20020a170902f68b00b001a258f15e1dmr15071264plg.36.1682896764643; Sun, 30 Apr 2023 16:19:24 -0700 (PDT) MIME-Version: 1.0 References: <20221201043155.9369-1-luolongjuna@gmail.com> <8767c6bc-5b37-ca10-1176-e341081c555f@gmail.com> <587de9c9-e46f-b69e-84d8-7356a19db74@codesourcery.com> <6ac6c8e6-d18a-8aae-2ae3-ecdfed291755@codesourcery.com> <86625ca4-6ef5-4010-e452-aa2e1149215f@gmail.com> <60cbe8fc-31b2-c8d7-4ea7-3a629cc5b6e0@gmail.com> In-Reply-To: <60cbe8fc-31b2-c8d7-4ea7-3a629cc5b6e0@gmail.com> From: Andrew Pinski Date: Sun, 30 Apr 2023 16:19:12 -0700 Message-ID: Subject: Re: [PATCH] libcpp: suppress builtin macro redefined warnings for __LINE__ To: Jeff Law Cc: Longjun Luo , Joseph Myers , gcc-patches@gcc.gnu.org, sangyan@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Apr 30, 2023 at 4:15=E2=80=AFPM Jeff Law via Gcc-patches wrote: > > > > On 4/30/23 12:30, Jeff Law wrote: > > > > > > On 1/12/23 09:02, Longjun Luo via Gcc-patches wrote: > >> From 0821df518b264e754d698d399f98be1a62945e32 Mon Sep 17 00:00:00 200= 1 > >> From: Longjun Luo > >> Date: Thu, 12 Jan 2023 23:59:54 +0800 > >> Subject: [PATCH] libcpp: suppress builtin macro redefined warnings for > >> __LINE__ > >> > >> As implied in > >> gcc.gnu.org/legacy-ml/gcc-patches/2008-09/msg00076.html, > >> gcc provides -Wno-builtin-macro-redefined to suppress warning when > >> redefining builtin macro. However, at that time, there was no > >> scenario for __LINE__ macro. > >> > >> But, when we try to build a live-patch, we compare sections by using > >> -ffunction-sections. Some same functions are considered changed becaus= e > >> of __LINE__ macro. > >> > >> At present, to detect such a changed caused by __LINE__ macro, we > >> have to analyse code and maintain a function list. For example, > >> in kpatch, check this commit > >> github.com/dynup/kpatch/commit/0e1b95edeafa36edb7bcf11da6d1c00f76d7e03= d. > >> > >> So, in this scenario, when we try to compared sections, it would > >> be better to support suppress builtin macro redefined warnings for > >> __LINE__ macro. > >> > >> Signed-off-by: Longjun Luo > >> --- > >> gcc/testsuite/gcc.dg/builtin-redefine-1.c | 49 +++++++++++++++++++++= ++ > >> gcc/testsuite/gcc.dg/builtin-redefine.c | 24 +++++++++-- > >> libcpp/init.cc | 2 +- > >> 3 files changed, 70 insertions(+), 5 deletions(-) > >> create mode 100755 gcc/testsuite/gcc.dg/builtin-redefine-1.c > > Thanks. I added a suitable ChangeLog and pushed this to the trunk. > This is causing regressions on various targets for a few tests: > > lm32-sim: c-c++-common/cpp/pr92296-2.c -Wc++-compat (test for > warnings, line 41) > lm32-sim: gcc.dg/cpp/undef2.c (test for warnings, line 9) > lm32-sim: gcc.dg/cpp/undef2.c (test for excess errors) > > I have reverted this patch from the trunk. Please address the > regressions and resubmit. >From c-c++-common/cpp/pr92296-2.c (line 40): #pragma push_macro("__LINE__") #undef __LINE__ /* { dg-warning "undefining" } */ gcc.dg/cpp/undef2.c (line 9): #undef __LINE__ /* { dg-warning "undefining \"__LINE__\"" } */ These testcases are specifically testing #undef of __LINE__ ... Should we be still warning for this case or not? Thanks, Andrew Pinski > > Thanks, > Jeff >