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.129.124]) by sourceware.org (Postfix) with ESMTPS id E42FB3857C72 for ; Tue, 30 Aug 2022 07:15:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E42FB3857C72 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-nc3gED2OPFu2CVNd2zY26g-1; Tue, 30 Aug 2022 03:15:04 -0400 X-MC-Unique: nc3gED2OPFu2CVNd2zY26g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD7F3803916; Tue, 30 Aug 2022 07:15:03 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D79451121314; Tue, 30 Aug 2022 07:15:02 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH] stdlib: DIAG_IGNORE_NEEDS_COMMENT setenv.c References: <20220829190021.946508-1-adhemerval.zanella@linaro.org> Date: Tue, 30 Aug 2022 09:15:00 +0200 In-Reply-To: <20220829190021.946508-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 29 Aug 2022 16:00:21 -0300") Message-ID: <87tu5u5hjf.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2022 07:15:20 -0000 Message-ID: <20220830071500.7MBDkUuhyc98eg7QYXu_cdv-pvmYbkvyrcosnYY9OaY@z> * Adhemerval Zanella via Libc-alpha: > Checked on x86_64-linux-gnu. > --- > stdlib/setenv.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/stdlib/setenv.c b/stdlib/setenv.c > index 2176cbac31..2add8bfb41 100644 > --- a/stdlib/setenv.c > +++ b/stdlib/setenv.c > @@ -19,12 +19,14 @@ > # include > #endif > =20 > +#if _LIBC > +# include > /* Pacify GCC; see the commentary about VALLEN below. This is needed > at least through GCC 4.9.2. Pacify GCC for the entire file, as > there seems to be no way to pacify GCC selectively, only for the > - place where it's needed. Do not use DIAG_IGNORE_NEEDS_COMMENT > - here, as it's not defined yet. */ > -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" > + place where it's needed. */ > +DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); > +#endif The comment was added in: commit 03c1e456b079929a8290aeb4aadb05c0df73bfd2 Author: Paul Eggert Date: Sun Apr 19 01:06:33 2015 -0700 Better fix for setenv (..., NULL, ...) =20 * stdlib/setenv.c (__add_to_environ): Dump core quickly if setenv (..., NULL, ...) is called. This time, do it the right way, and pacify GCC with a pragma. Paul, what did you mean when you wrote =E2=80=9Cnot defined yet=E2=80=9D? = Is it a gnulib thing? Thanks, Florian