From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-h1p-028595.sys.comcast.net (resqmta-h1p-028595.sys.comcast.net [IPv6:2001:558:fd02:2446::3]) by sourceware.org (Postfix) with ESMTPS id 2CCC13858D39 for ; Sun, 17 Mar 2024 17:48:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CCC13858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=comcast.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=comcast.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2CCC13858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:558:fd02:2446::3 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710697710; cv=none; b=s/L1Ap6krWcxVaWND1lWG2Xfd0UGT9ADs/0OmpqSOmuxoLfzXAmS7iVqlod/EHLlythrPlNgzRjFouwGhMjfyOIUzkbQszBjE7cCbFKg7khMz1XyHnphoC43OHFfX/iMptAhxzNjJJ8A+lJGZomb7dmB025hYQKFctiOJYqoshI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710697710; c=relaxed/simple; bh=EZB/MZObiQktFtA1NJD64R1xxMzWhTrkmfXfQNMqI5Y=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=rnZbxo6j+2YN4H/5vPaMj3XIlyd0SnBiM4JT6SXHU5bHdzNWJHpsgA/fBHknKZv9QxY1siCNs3Qw5ALYYeAZlxv2adUeBtqAXUJzVe8C2+R91+x+/TrPoqfIlocORpv02nxagnEuGItRSdagLvHReQ8H9xZ8wy/xOfFq7ETatss= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from resomta-h2p-555029.sys.comcast.net ([96.102.179.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resqmta-h1p-028595.sys.comcast.net with ESMTP id luHprkjgokH6slucSrZeJQ; Sun, 17 Mar 2024 17:48:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1710697704; bh=1bFo90muQZrWEFvBZiWMrfz50mkRO2VmBVHVPXGiY7g=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To:Xfinity-Spam-Result; b=nbKOwVt3umYfM7sXJZTgwzFAeEq6o3vTaMZriZjybfzfsRchtO/5Z9FhxGnEy8xZL tjehk9fNamRU2J18/RBj/HtLDnp57V4ejV2wAcA3v914gdqeBVNXWxFI5GWqA9G2Qi fUHmX0SMTgZpcUUhtr1N7FmiZ5Z4vznKZs0nhK3d+M8gw1JkFfS1RDggjIXw3rzEux 5Al2VuUIkU4tY37PRFQtm+lTOD8Qe/cws24KHa/q+WRiC4mkCX2XNesR5yPlRdkZFW wua7wkqvMxdKWIE+bF3i6OXiQz1dykLDHSH0l8hghPgVhI+/z1C+u5hzKHc5BmN5dg HLhd1PHGh4hxw== Received: from smtpclient.apple ([IPv6:2601:644:907e:710:963:a2e3:68ac:59f4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-h2p-555029.sys.comcast.net with ESMTPSA id lucPr3U0mPOJWlucQrDLBh; Sun, 17 Mar 2024 17:48:23 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: [PATCH] testsuite: Define _POSIX_C_SOURCE for test From: Mike Stump In-Reply-To: <20240310172608.2979427-1-torbjorn.svensson@foss.st.com> Date: Sun, 17 Mar 2024 10:48:21 -0700 Cc: gcc-patches@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: <79ADB141-521F-469D-B560-9F6572B12B5E@comcast.net> References: <20240310172608.2979427-1-torbjorn.svensson@foss.st.com> To: =?utf-8?Q?Torbj=C3=B6rn_SVENSSON?= X-Mailer: Apple Mail (2.3696.120.41.1.4) X-CMAE-Envelope: MS4xfBLBD2eQkwNyFTW1m+4HKvXXMQipBXotKXpnnRhP+hv22xs62A6qpPbHvbyiBaZSOaheD0zXmU22hFY6afDZ34k5Bu40rvxWdjB3U6hGhMBwggN6ekt6 CQ7dpYF4cQRnjsOiHOlhpdzUbE2JbwG8O5YKfAotxHVKhAzskjSGiwtR1HrSZecXS3HDa0ixFHv2mberY1/EeSq2ETKY9NJ6v2JkLdISA/T119c3z8DDxS5Q 60wfg1mQS0eDvCWK1eAUqRsVaY+Fb3QtnsgnzToBmTerXWHPbANaFOY4aoDqcmelg9elueo6O+T9ZfB5TWwAVA== X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,SPF_HELO_PASS,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 Mar 10, 2024, at 10:26 AM, Torbj=C3=B6rn SVENSSON = wrote: >=20 > Ok for trunk? Ok. > As the tests assume that strndup() is visible (only part of > POSIX.1-2008) define the guard to ensure that it's visible. = Currently, > glibc appears to always have this defined in C++, newlib does not. >=20 > Without this patch, fails like this can be seen: >=20 > Testing analyzer/strndup-1.c, -std=3Dc++98 > .../strndup-1.c: In function 'void test_1(const char*)': > .../strndup-1.c:11:13: error: 'strndup' was not declared in this = scope; did you mean 'strncmp'? > .../strndup-1.c: In function 'void test_2(const char*)': > .../strndup-1.c:16:13: error: 'strndup' was not declared in this = scope; did you mean 'strncmp'? > .../strndup-1.c: In function 'void test_3(const char*)': > .../strndup-1.c:21:13: error: 'strndup' was not declared in this = scope; did you mean 'strncmp'? >=20 > Patch has been verified on Linux. >=20 > gcc/testsuite/ChangeLog: >=20 > * c-c++-common/analyzer/strndup-1.c: Define _POSIX_C_SOURCE. >=20 > Signed-off-by: Torbj=C3=B6rn SVENSSON > --- > gcc/testsuite/c-c++-common/analyzer/strndup-1.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/gcc/testsuite/c-c++-common/analyzer/strndup-1.c = b/gcc/testsuite/c-c++-common/analyzer/strndup-1.c > index 85ccae85d83..577ece0cfba 100644 > --- a/gcc/testsuite/c-c++-common/analyzer/strndup-1.c > +++ b/gcc/testsuite/c-c++-common/analyzer/strndup-1.c > @@ -1,4 +1,5 @@ > /* { dg-skip-if "no strndup in libc" { *-*-darwin[789]* *-*-darwin10* = hppa*-*-hpux* *-*-mingw* *-*-vxworks* } } */ > +/* { dg-additional-options "-D_POSIX_C_SOURCE=3D200809L" } */ >=20 > #include > #include