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 C1B863858D1E for ; Sun, 1 Jan 2023 07:43:13 +0000 (GMT) Received: by mail-wm1-x32f.google.com with SMTP id m26-20020a05600c3b1a00b003d9811fcaafso11822112wms.5 for ; Sat, 31 Dec 2022 23:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lPEUdsgNCyI01zxbDVRklJsJpPAgnskgPDyFbc4QE5Q=; b=lt6YNswWcgBlkR82gr9en0UQH9lGBNSGZIm26x1VQlMSK9SVXTZbuIo7YJU1i6oNEm UhrEq2Av1StIimP9ujSHavjghtAG/9DjKwwJsQCSZs6AJjcoAGZkqe7uKkJlJCe/guCJ 8054fFXIg5DXEcUFszZbj+n6+3V4huFZ34vR2UcWoj0vDpaqzL+BLT9Oif7nXg0fIAvo nOdwUY0ZzKOOsQZ8zkf+DYq4QjXE3DoTDyNPIQ3U+8ElzS05qbJqKM2PSgXrjdm21tPe LD1ZJrfH8t9zyjLskXEDtpup5PSYGqPa45yPhEZ5LRrdMYZlu1iry7kklyXbgwoPIn9m FKnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lPEUdsgNCyI01zxbDVRklJsJpPAgnskgPDyFbc4QE5Q=; b=g12T/9jOtdrhydVETa06LS9ve34WaycHjtZYIL8LRxVkJksfj0pCAT4BRYCsdKMLeK 0dk0k3pBTX/Rw3zTnH7MDBrVwoRnYkcV+5emmpc3P39fc8m7DaS0af5eMTiyK+Ew5oT3 VXzj9LRui87mQlI5lhDRT94yx5y0aS042gOLjAC4+E8NpkMFhY2SZO/aADuG6dRdIMVj cqKxHCZff1jMQrH9Q5UzhEuUXh1+gqdJlJQQLSCC2GEwzSv2jL3xhM/+hlVtJiibHGht h+/q+tscG6iS+tU7uVzjXFURvBOTvC9dzlqcZGV1BtU0pcx7d9rWLBM6Ag+jZbvQ2LG0 eoHA== X-Gm-Message-State: AFqh2kr5vVJSOhI3KyPEyz3s0A6s/8nY4VzwwrfTuIvYUkkw7co0IN4C W3FA9Y2Jfmmb6tgnsDvWTMP4mw5UXbDhCp0qGAYzKw== X-Google-Smtp-Source: AMrXdXuACGjavWb+lm+WRa4EKQt73K3sftbgOHJNbHILcGxAbENDUNSSQeGjHSQTCT8E426mr/+rJIGEUGa+nfbK+/E= X-Received: by 2002:a05:600c:4e51:b0:3c8:353b:2553 with SMTP id e17-20020a05600c4e5100b003c8353b2553mr1709301wmq.18.1672558992173; Sat, 31 Dec 2022 23:43:12 -0800 (PST) MIME-Version: 1.0 References: <881e795d-34c8-0445-74cf-cb68192d2dfe@jguk.org> In-Reply-To: From: Prathamesh Kulkarni Date: Sun, 1 Jan 2023 13:12:36 +0530 Message-ID: Subject: Re: [Bug c/108224] [PATCH] add srandom random initstate setstate To: Jonny Grant Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 Wed, 28 Dec 2022 at 04:01, Jonny Grant wrote: > > > > 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-header= s.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, enu= m 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. Hi, Sorry for slow response. It depends on how you configured gcc. If bootstrap is enabled (which is by default), then make would bootstrap gcc. Typically for development, we disable bootstrap by passing --disable-bootstrap to configure for faster builds, and then validate the patch with final bootstrap+test. For regression testing, you'd have to (1) Bootstrap the trunk without the patch, (2) Bootstrap the trunk with patch, (3) Compare the two build dirs with $gcc-src/contrib/compare_tests. and address issues for the FAIL'd tests. > > 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 =E2=80=98make check-c=E2=80=99 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 instal= led? > > Would be good if "make check" quickly failed if the "runtest" command fro= m dejagnu was not found. > > I needed to install these two packages. Would be good to get a hint when = running =E2=80=98make check-c=E2=80=99 > autogen dejagnu > > > For the files like missing-header-fixit-4.c is it sufficient to just add = a file to that folder? Yes, adding the file in $gcc-src/gcc/testsuite/gcc.dg/ should be sufficient= . For eg, to only run missing-header-fixit-4.c this should work: make check-gcc RUNTESTFLAGS=3D"dg.exp=3Dmissing-header-fixit-4.c" Thanks, Prathamesh > Cheers > Jonny