From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id A21A53858D1E for ; Mon, 19 Sep 2022 14:05:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A21A53858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-127dca21a7dso61943254fac.12 for ; Mon, 19 Sep 2022 07:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=sB/r+8eTobDoJao+Bhtu+kRavppulSQI1Z0B9FtHOSI=; b=weaoAZvyBq0GoknmD3RvhebSRmJYcwz6hZMnGyLJaBKEqMqeE7MQIjyKIMoQYtqAbl 2C0tHndDpT2WJmA904lddFOyCjds6wHCTg8N3Hgk9hlzjzpzIItGyjMWOKBeQKIhumRt STPdYj0g081IICG9WbJGw+VETIn13HYxbs11zODKSFq7llQpvBi2pZAqGmGpnCsjQytw 9A9/pdx7XTK3/l25UTUaO1IJMf9hfc4JL9wFOi8adW3BYkYPSoIGWFH5DJ+xPU7AmYbR up9wwxtYEK4tX8twVSrEOjEU0CzhPbA3pzi0lAZcKu4qonC/tmu22WPaUf/dkQNu7ggP b5Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=sB/r+8eTobDoJao+Bhtu+kRavppulSQI1Z0B9FtHOSI=; b=IRbUbg0eSZFSz6SeLu2Fxs7+E9+eFTnL3nGr+gmVZuuaLtWANCFYGn4eT5zYsrQd6j FJbFTfwK58lv0h9TxqtLtan4+CrelzKWWQ/pUIUAwvAxrC065RdHCxKgmEJxaZjV6Sk6 AQPoGOzdmWVQS8uBfWT7a9rsZSop/DUbefefPrm9KK27mEzGMO4AAX6nG+uJsOGaRQNN bm1BXyvNtx61F8zLWlqPvDG2uzMEAV004XVADriHQpEgJOkKJISDKKivreetXp/h/E4H dl9A0wDWYs/t2xOGTmhfK0PsdptmApgemvCegaOLInZXa536HhKm9UMRrtHkPYsCLN6q SgTA== X-Gm-Message-State: ACrzQf3pjTQsKrcuAE9P4PcBZmQC3yUTT2CUGncfB8h36eNG1LybZt8k pyGiG8XTrPQFmVA7TkR4q2JlyMGjGB2eFMOY X-Google-Smtp-Source: AMsMyM4Ul2psMNW2esG0aeRZhFx+JhcELRH4rLef6TfOAxfHYkEGJlNub13C4bRo0eXa0uruaeqwbA== X-Received: by 2002:a05:6870:311a:b0:12d:130f:bbb2 with SMTP id v26-20020a056870311a00b0012d130fbbb2mr2762871oaa.76.1663596334906; Mon, 19 Sep 2022 07:05:34 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:c266:6474:c804:752d:521c? ([2804:1b3:a7c1:c266:6474:c804:752d:521c]) by smtp.gmail.com with ESMTPSA id o6-20020a4ae586000000b0044afc1ba91asm12509516oov.44.2022.09.19.07.05.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 07:05:34 -0700 (PDT) Message-ID: Date: Mon, 19 Sep 2022 11:05:31 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] stdlib: DIAG_IGNORE_NEEDS_COMMENT setenv.c Content-Language: en-US To: Florian Weimer , Adhemerval Zanella via Libc-alpha Cc: Paul Eggert References: <20220829190021.946508-1-adhemerval.zanella@linaro.org> <87tu5u5hjf.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87tu5u5hjf.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 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 30/08/22 04:15, Florian Weimer wrote: > * 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 >> >> +#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, ...) > > * 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 “not defined yet”? Is it a > gnulib thing? Paul, is anything to prevent us to use DIAG_IGNORE_NEEDS_COMMENT here? For glibc it is the best way to possible handle different compiler that might not need to define it.