From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74235 invoked by alias); 8 Jan 2020 18:42:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 74220 invoked by uid 89); 8 Jan 2020 18:42:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1086 X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Jan 2020 18:42:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578508951; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cVz3nKbVnqO2joklj3Bt6DMBsjeNoMTWHtOeoHseLK8=; b=dx4YxHdBoacQRbONDfmgfjQZ9JL95m7ozpUveJns2iBrW4lP343YNmwBJxOppz2PkIAOkK YlRn3l39XQRVfjIWx0Y3DaCH+Kp6S6IuqSJyPlhcHxuX7ohmC4gmNotgiV264Ui0bxMLMO Slmu30/GEcO4q4WegSxLp+wEnPE5AVs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-YBzzqiThPOKgNRj0CSRxZQ-1; Wed, 08 Jan 2020 13:42:28 -0500 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 02AEB801E76; Wed, 8 Jan 2020 18:42:27 +0000 (UTC) Received: from ovpn-112-38.phx2.redhat.com (ovpn-112-38.phx2.redhat.com [10.3.112.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F4015C241; Wed, 8 Jan 2020 18:42:26 +0000 (UTC) Message-ID: <47bafa6f8ab0a8f1e4de191bbe56557eac808390.camel@redhat.com> Subject: Re: [PING 3][PATCH] track dynamic allocation in strlen (PR 91582) From: Jeff Law Reply-To: law@redhat.com To: Andreas Schwab , Martin Sebor Cc: gcc-patches Date: Wed, 08 Jan 2020 18:42:00 -0000 In-Reply-To: References: <081f0235-96b3-988b-5605-ed5a0805b3c7@gmail.com> <5cf529c3-f69a-46c8-93fc-cce673e02b5c@gmail.com> <4e6a8395-0bc7-8820-7222-99a3bf3d2f3a@gmail.com> User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00383.txt.bz2 On Wed, 2020-01-08 at 12:52 +0100, Andreas Schwab wrote: > On Dez 06 2019, Martin Sebor wrote: > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c > > new file mode 100644 > > index 00000000000..249ce2b6ad5 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c > > +void test_strcpy_warn (const char *s) > > +{ > > + { > > + const char a[] = "123"; > > + /* Verify that using signed int for the strlen result works (i.e., > > + that the conversion from signed int to size_t doesn't prevent > > + the detection. */ > > + int n = strlen (a); > > + char *t = (char*)calloc (n, 1); // { dg-message "at offset 0 to an object with size 3 allocated by 'calloc' here" "calloc note" { xfail *-*-* } } > > + // { dg-message "at offset 0 to an object with size at most 3 allocated by 'calloc' here" "calloc note" { target *-*-* } .-1 } > > Please make the test name unique. I've got a patch to do that in my local tree. I'll push it momentarily. jeff