From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A460F3858D37 for ; Wed, 2 Mar 2022 10:13:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A460F3858D37 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-XK383K0EPFeLNYy-mJxpTA-1; Wed, 02 Mar 2022 05:13:03 -0500 X-MC-Unique: XK383K0EPFeLNYy-mJxpTA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E5A9801DDC; Wed, 2 Mar 2022 10:13:02 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4A627B6E8; Wed, 2 Mar 2022 10:13:01 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 222ACwd1971611 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 2 Mar 2022 11:12:59 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 222ACvx7971610; Wed, 2 Mar 2022 11:12:57 +0100 Date: Wed, 2 Mar 2022 11:12:57 +0100 From: Jakub Jelinek To: Martin Sebor Cc: Richard Biener , Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] warn-access: Fix up check_pointer_uses [PR104715] Message-ID: Reply-To: Jakub Jelinek References: <2f312e75-772b-e8b6-ecbe-01daff873526@gmail.com> MIME-Version: 1.0 In-Reply-To: <2f312e75-772b-e8b6-ecbe-01daff873526@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2022 10:13:08 -0000 On Tue, Mar 01, 2022 at 12:07:49PM -0700, Martin Sebor wrote: > Thanks for the fix. It makes sense to me. Besides the test for > the false positives I would suggest to add one to verify that using > the first argument to a strstr() call is diagnosed if it's dangling > (both as is, as well as with an offset from the first element). > There are tests for memchr and strchr in the -Wdangling-pointer > test suite but none for strstr. Thanks for adding that test. Note, as I wrote in the PR, I think we should handle BUILT_IN_STRPBRK like BUILT_IN_STRSTR in pass_waccess::gimple_call_return_arg, but as that would emit further warnings, I think that has to be a GCC 13 material. Jakub