From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 6133B3858436 for ; Wed, 22 Mar 2023 22:50:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6133B3858436 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-pg1-x52f.google.com with SMTP id y19so11520376pgk.5 for ; Wed, 22 Mar 2023 15:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679525405; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=YbA4KxsBEwGkDhr93S/p05nUNPT5Sn2gED4Db4EYarc=; b=jSCmgvz9j/WzunGikujstKlOKN6cBzgxHQj6ZnjPf0n53KnHLU/qrpN+nOT/Sx7xC/ M2EUDlvneiBoc0bF5Xa8fd5g+UmD8iMvL6upV4h7G8gbRcmB7e8RP5sKLwwRZKbLJ4FW CaSXpZkPXSw2iDG+vLerE7AXCI9WMMrXD4HpcOMQm7OVIho6DRx+AoamzOUF8Ax0oiDw 9BzbKYScI6YrKvxre8ExBU3QlWmJC3s0Y+1uKWk0ohSVkYmXCQy1FcrprGbW5UqUcKXF Mh75ATIar9h2/0JMN+TuGiMSFhFCL/XTFjWc5I5lpuEBZ8ECBc9KTUYLcsFGvG+pBI2A sKbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679525405; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YbA4KxsBEwGkDhr93S/p05nUNPT5Sn2gED4Db4EYarc=; b=CdPXL4Aad6XNs5ia4eyqsdmlFlwh9dhgZbCTHHjffFxvViC2sejhDy3rGVD8cP6LIw dPlu88EJMKiNoZPxXvQ5538h6ntJGVHesAg86HR2AdE/F31yYdMonmqMRSLRxhtHqGrb pixBrH/045pW66McxSC77ggDpdNYu2EvNpcl67bGcugo6DS1KQLFRUTa8QxFHXiXAldg SLPUVnwm71HAOthAoOQI+doSfm/YfYCQ00iL5GDMYpgbw9If+sbwkAVVpIAa0rjzrJ8W 0BZKXpxgLXPPeiFU1gA5HhgtCJBAWLnT1Qnobf/X3iuDAeXvf1pA2bKfgP81OA7xq5oO FOzA== X-Gm-Message-State: AO0yUKUrkovxrtfsO3/ZPsVegVSSRXpYoy9KuSfJfF9U8dcQRp5jEk0r fY8ZfpMVu0KbHX46+AGO091aAyz7eFh8UdPEsQ== X-Google-Smtp-Source: AK7set8SiisIqdgv3mdgcMkIfyvCJgCkkSd8zA4TNDAMkDxtQQn5B1SGWzoDP4d8L2Ze/2lYlHbioIBcfZ8nA/OreSM= X-Received: by 2002:a05:6a00:99d:b0:628:fc:9049 with SMTP id u29-20020a056a00099d00b0062800fc9049mr2719958pfg.4.1679525405037; Wed, 22 Mar 2023 15:50:05 -0700 (PDT) MIME-Version: 1.0 From: Benjamin Priour Date: Wed, 22 Mar 2023 23:49:53 +0100 Message-ID: Subject: Re: [GSoC] Discussion of warnings and of a first patch (name-hiding) To: Jason Merrill Cc: David Malcolm , gcc@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000289a3505f784fb82" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,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 List-Id: --000000000000289a3505f784fb82 Content-Type: text/plain; charset="UTF-8" Hi Jason, Sorry for the delayed answer, I was in my exam period! I've almost finished the patch (PR12341 ), and wrote a testcase to compare it against. In it I use dejaGNU instructions of the format: /* { dg-warning "'C::bbb' might shadow 'B::bbb'." "" { target *-*-* } C_shadowing_bbb } */ and run the test with: make check-gcc-c++ RUNTESTFLAGS="-v -v --target_board=unix\{-m32,-m64\} dg.exp=pr12341-1.C" I get expected results on most target, except on target hppa*-*-hpux*. I have been looking around the documentation, yet I cannot find a way to run on that target specifically, especially considering the wildcards. How to test GCC on a simulator don't specify that target in the bottom table. Would you have any guidance on how to do so ? I would like to debug the test on that platform. Otherwise, I believe it is working just fine, I put it as an enhancement to -Wshadow. Should I send it to gcc-patches ? I wasn't sure I was supposed to since it's still buggy, so I preferred to refrain. > Up to now I have considered some extra warning > 1- Warning for NULL smart pointers dereferencing. E.g. when a smart > > pointer is left uninitialized yet is derefe0renced. > > I would expect that to be covered by (enhancements to?) the existing > -Wuninitialized or -Wmaybe-uninitialized or > -Wanalyzer-use-of-uninitialized-value. > > > 3- Use after move. > > Hmm, it might make sense to approach this as an enhancement to the > uninitialized warnings whereby a move makes us consider the object no > longer initialized, much like -Wuse-after-free and > -Wanalyzer-use-after-free. > > > 4- Use references or raw pointers as parameters when ownership is not > > considered. (For general use, take T* or T& arguments rather than smart > > pointers > > < > https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f7-for-general-use-take-t-or-t-arguments-rather-than-smart-pointers > >) > > This seems feasible to implement in the front-end. > > I will update on these warnings and a few questions on the analyzer tomorrow, I now got some free time back. Benjamin --000000000000289a3505f784fb82--