From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jK2ht-0007GT-MK for mharc-grub-devel@gnu.org; Thu, 02 Apr 2020 12:28:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK2hr-0007G3-6X for grub-devel@gnu.org; Thu, 02 Apr 2020 12:28:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK2hq-0003uY-0V for grub-devel@gnu.org; Thu, 02 Apr 2020 12:28:39 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jK2hp-0003sG-LM for grub-devel@gnu.org; Thu, 02 Apr 2020 12:28:37 -0400 Received: by mail-wm1-x341.google.com with SMTP id j19so4365625wmi.2 for ; Thu, 02 Apr 2020 09:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IKIdAS/kdHKxDixiFigGGpubB5H4FLUoiFAshbDeRGc=; b=F5254clnWOswCtc/pgWSWbJx/D0bUaqR4qr5BmhnJD88GzmxF/NeNCtgHnvs9Qurno +J2ykhYd4HYpFkWVr6AgIY1r/YhU/R+AXrEH7V1hVq5Fbuip02NB+L3gRGEWknNDP++a 34KeRM+ntn9+BN+fkVBb2tyiqX+uw/y5+jidMwtn7UMHQJofUsBL86fFgftPNvEyP42U wOyerCfqNTD9TxFiDSsUshVxBAjoFC/rmJZepzUWwQ2smQAAOnR8XKEsB3PbdgfkrOS9 5pCIZK1/3YTX4Rp/AQEEfsGmY/12KI3PWCKKcP8yx2CM8hRuS3rMa9iE9QZX4QTz+BPV 7NDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IKIdAS/kdHKxDixiFigGGpubB5H4FLUoiFAshbDeRGc=; b=udhjSeNM1DASjKfZ9VHWSgn5c2u5A5xNOSP7CavaXwG68C49XbNSNlNRpac7uPCauO GEoj78KMSgqEmTL534WNRQO/hJVmcYmKEt5bnzyg2I0IKpKZGJy342xVQ3BVvoWAu7WG F1sYkqTlmHMlrtk6ajMQVxCG/Aw6nMStMRsMLHDLQ3FqQ4QTykGchj+V4+EHq21BzXq7 9ihZgN1+ABY9vbBuSRxXdDsKivvSlkL1DGFL7pkO7FJB9TPbJ1G7fljt2yHaccVGeGq2 qX7ROd7VrbejiUi7KyuKjlKb+2XE1EnbQjMglp06YN6wMyfsb8WD8tEerje9ckmM/ZCL 5Zqg== X-Gm-Message-State: AGi0PuZINTXm81USThpY50vubzNJz5ty34c2YNYiYO2IhwR6+RBuhQid gAmmE7pEbpNFubM8S+Yb2oHbRQ== X-Google-Smtp-Source: APiQypLgvAsw1AiyjYb9Lvri3dyiOmb6iCoAbgJQjXjsZU0F64sLdFFdU4akfkx9u+FUsfRPMQpamA== X-Received: by 2002:a05:600c:29a:: with SMTP id 26mr4156126wmk.172.1585844916049; Thu, 02 Apr 2020 09:28:36 -0700 (PDT) Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id v7sm8060014wrs.96.2020.04.02.09.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 09:28:35 -0700 (PDT) Date: Thu, 2 Apr 2020 17:28:33 +0100 From: Leif Lindholm To: Daniel Kiper Cc: grub-devel@gnu.org, javierm@redhat.com, olaf@aepfle.de, phcoder@gmail.com, pjones@redhat.com Subject: Re: [PATCH 1/3] configure: Enforce gnu99 C language standard Message-ID: <20200402162833.GQ7468@vanye> References: <20200402150750.6665-1-daniel.kiper@oracle.com> <20200402150750.6665-2-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402150750.6665-2-daniel.kiper@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2020 16:28:40 -0000 On Thu, Apr 02, 2020 at 17:07:48 +0200, Daniel Kiper wrote: > Commit d5a32255d (misc: Make grub_strtol() "end" pointers have safer > const qualifiers) introduced "restrict" keyword into some functions > definitions. This keyword was introduced in C99 standard. However, some > compilers by default may use C89 or something different. This behavior > leads to the breakage during builds when c89 or gnu89 is in force. So, > let's enforce gnu99 C language standard for all compilers. This way > a bit random build issue will be fixed and the GRUB source will be > build consistently regardless of type and version of the compiler. > > It was decided to use gnu99 C language standard because it fixes the > issue mentioned above and also provides some useful extensions which are > used here and there in the GRUB source. Potentially we can use gnu11 too. > However, this may reduce pool of older compilers which can be used to > build the GRUB. So, let's live with gnu99 until we do not discover that > we strongly require a feature from newer C standard. > > Signed-off-by: Daniel Kiper > --- > configure.ac | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 88c0adbae..b7f40a1c3 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -75,9 +75,16 @@ grub_TRANSFORM([grub-sparc64-setup]) > grub_TRANSFORM([grub-render-label]) > grub_TRANSFORM([grub-file]) > > -# Optimization flag. Allow user to override. > +if test "x$BUILD_CFLAGS" = x; then > + BUILD_CFLAGS='-std=gnu99' > +fi > + > +if test "x$HOST_CFLAGS" = x; then > + HOST_CFLAGS='-std=gnu99' > +fi > + > if test "x$TARGET_CFLAGS" = x; then > - TARGET_CFLAGS="$TARGET_CFLAGS -Os" > + TARGET_CFLAGS='-Os -std=gnu99' > fi Do these not add -std=gnu99 only if *_CFLAGS are not specified? Would we not want to override these always? For example, Debian/Ubuntu override HOST_CFLAGS when building grub. / Leif > > # Default HOST_CPPFLAGS > -- > 2.11.0 >