From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 787493858D37 for ; Tue, 27 Dec 2022 22:31:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 787493858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jguk.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jguk.org Received: by mail-wm1-x32f.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso10245423wmp.3 for ; Tue, 27 Dec 2022 14:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=BnAe2CtqqzAkXMVWp549AARqS9Q+UIB+kSzjPCN1f4k=; b=i9SpOBopXMARj6oDcGQ6n/xy6rFsQFb+XBXdZbP60HDvFXswXa7IoISQf6H68XBEDa 89irqzmJlNnnGZUIFDw+g2cNQmdXmElYtmXV2hxW0sDBDe054HfSi0uIPJLTkTFoAgWz WLSRKjDJYJP8TKIeFoO23JiIvJRG3bkGVaPfHJsi51QzzTN0RDU/E/b3eKM/xrueN2n1 SrsBsjbkTguIXbE2DTPg2C4cxpvoJ8ky7Xh/pQHSsXUQrQ6Qs9JmNtekvydqdTvFfvGK 7awEUgawFqZeFYJ06xaD6BNgEyDynuxhTlm6jSSClW1gm3h0/bRD0zQrzwSte867GSlM 7r1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BnAe2CtqqzAkXMVWp549AARqS9Q+UIB+kSzjPCN1f4k=; b=2zaGBXIzxgy2gdRw0cagveloFTDRiFKMLl+txxJ7D7fRxw2Gsgn+qQ6W96v5ad07kw xPaMz4vBN865eHVNjgpTcFCP4vB9sCkWEFfBdBb2IKg6QrzPsvFi582hhSbvWXjp5ZeJ i3B9lIIdlbgFU7/a+qXsPvOw/kPGTy1crDmQsyAs0wR7a++TVS5TnRXOEtpG+JnoiRxq KLmg/BKy7rnJKsdXkdL24ag1Mqw2fQORodhgTmhL9+OfxmA5o3YOB5iscBDoHMOznEPT jCLcVrrUWRW3wFp0uGJ9yCJxp1iuNZ+s9y0qz3pKL82hko83iuI0NfxS/EbnkL00HNdU QGlg== X-Gm-Message-State: AFqh2kqSd043xAWfqp6U3tz3sYLaefSnLB3t1BfC0xAUZp2ZskAA0hy6 gnaAoEC60SaehbAHsqA5C2kWdg== X-Google-Smtp-Source: AMrXdXvhFx4PiSSlEp5Iart3vOfJ9hTL25SesHDIkYPo7cGDY5BWiXElgIQxuDJwe1JUkHPvllIAQw== X-Received: by 2002:a05:600c:1604:b0:3d5:b222:20a with SMTP id m4-20020a05600c160400b003d5b222020amr16376424wmn.32.1672180296212; Tue, 27 Dec 2022 14:31:36 -0800 (PST) Received: from [192.168.0.12] (cpc87345-slou4-2-0-cust172.17-4.cable.virginm.net. [81.101.252.173]) by smtp.gmail.com with ESMTPSA id n25-20020a7bc5d9000000b003d969a595fbsm18697722wmk.10.2022.12.27.14.31.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Dec 2022 14:31:35 -0800 (PST) Message-ID: Date: Tue, 27 Dec 2022 22:31:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: Jonny Grant Subject: Re: [Bug c/108224] [PATCH] add srandom random initstate setstate To: Prathamesh Kulkarni Cc: gcc-patches@gcc.gnu.org References: <881e795d-34c8-0445-74cf-cb68192d2dfe@jguk.org> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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: On 26/12/2022 09:19, Prathamesh Kulkarni wrote: > On Mon, 26 Dec 2022 at 14:25, Jonny Grant wrote: >> >> >> >> From 6ff344979af46dbcd739dd9068d6d595547e4c27 Mon Sep 17 00:00:00 2001 >> From: Jonathan Grant >> Date: Sun, 25 Dec 2022 22:38:44 +0000 >> Subject: [PATCH] add srandom random initstate setstate >> >> --- >> gcc/c-family/known-headers.cc | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/gcc/c-family/known-headers.cc b/gcc/c-family/known-headers.cc >> index 9c256173b82..ade9fa2dcc0 100644 >> --- a/gcc/c-family/known-headers.cc >> +++ b/gcc/c-family/known-headers.cc >> @@ -171,6 +171,10 @@ get_stdlib_header_for_name (const char *name, enum stdlib lib) >> {"getenv", {"", ""} }, >> {"malloc", {"", ""} }, >> {"realloc", {"", ""} }, >> + {"random", {"", ""} }, >> + {"srandom", {"", ""} }, >> + {"initstate", {"", ""} }, >> + {"setstate", {"", ""} }, >> >> /* and . */ >> {"memchr", {"", ""} }, > Hi Jonny, > Thanks for the patch. A couple of things: > (a) Could you please add a test-case for the above symbols ? See > testsuite/gcc.dg/missing-header-fixit-4.c > for a similar example for printf. > (b) The patch is missing changelog. > I assume you've tested the patch with bootstrap+regtest ? Hi Prathmesh Many thanks for your reply. I built gcc by typing "make", I understand that is the bootstrap. I don't know about regtest, could you direct me to a guide please. I didn't add a test; I can do that now. Is there an FAQ you can direct me to to run those tests please. Running ‘make check-c’ now, its taking along time on gcc.c-torture. Is there a way I can quickly run only the gcc.dg missing header tests? BTW, do you know if a change could be made to detect dejagnu being installed? Would be good if "make check" quickly failed if the "runtest" command from dejagnu was not found. I needed to install these two packages. Would be good to get a hint when running ‘make check-c’ autogen dejagnu For the files like missing-header-fixit-4.c is it sufficient to just add a file to that folder? Cheers Jonny