From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jLlq1-00060L-WA for mharc-grub-devel@gnu.org; Tue, 07 Apr 2020 06:52:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46739) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLlpz-000607-8p for grub-devel@gnu.org; Tue, 07 Apr 2020 06:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLlpy-0004Tx-3f for grub-devel@gnu.org; Tue, 07 Apr 2020 06:52:11 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:39579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLlpx-0004TD-Oe for grub-devel@gnu.org; Tue, 07 Apr 2020 06:52:10 -0400 Received: by mail-wm1-x341.google.com with SMTP id y20so1313940wma.4 for ; Tue, 07 Apr 2020 03:52:09 -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=mxJHmINekUqUtWlLhhqX592oCb2BvFOby+Q8WCjSvfI=; b=kKL3pbwkUKpv1AERI2aSHTwWysxMr3A/ubJFXgRsccOO7yYNnYhK2lr6U5p0OdNcK/ 4vVk3/MTJv5jsdf5DQpxSin2Vw+EGWqBFfZwRdzBWynvcAFGaPycFrrdmOu7X8GvseBA y4GvqJ1a12csxwa1GFsIz/N+PCqi8jsF3mft9g20QpaIjsDNDHefUaUMopaOOrCuSX2J X2pQ2EFdztL9vS05YmAlfo72w8Apu1UUJWLNCrd/x9fv4HeBbk9QIDi17EfiiCfscgGR niyzU3j/Gmx/wFPNfA/2KXVbq9iO2ODqbir6/+W9vJrVtm9XCMCGV3XXjomaxrhzkYa+ H4Ag== 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=mxJHmINekUqUtWlLhhqX592oCb2BvFOby+Q8WCjSvfI=; b=t+1r6o15GTCtcEkQSUF6n5Zy9mDpM/0ZYYijSMvjzgbDTvskbitzW+Bi59SDGHOEN3 1qEEqyF8kkNbL4XdPY/hhUg7ujKCB8/xH9TwCHUp/iUeTFi49knGq8Z1mkKH8UA7dioj dhjBVsMuUt3lLhfFhIAeKD+QI1ramDvdIj9fXOY6NfZW71AmhcxphbbZWqOsBpVlf97U nPEkPtR3STsyKoK+bKvZ1QY4hb3vV75g0SIn1+kUADWl8+x5L1jBwpBZlmQvn6oyJmci fxx7/iGqQ4rOXTZo/w1/YbkGIldBncCyOgXYK9pu/zv7OL4HjN3bQwj0JHaEr6GPwMpV GKcg== X-Gm-Message-State: AGi0Pubu71gTQ9rMF/D+XDRiphTOmDnPjDxNM2Sx8LJiBNsDXiMCe/Ey 7adR+ewmqnFl99Gt9IDdtpp7wg== X-Google-Smtp-Source: APiQypJ1n5Kc+2fYoldIg14pRegz8AToOGGjGVxr/vSNKgRP/omMiTBNP0PWAZ3dr9+PfvFTGgJDfQ== X-Received: by 2002:a1c:2e4e:: with SMTP id u75mr1741662wmu.2.1586256728229; Tue, 07 Apr 2020 03:52:08 -0700 (PDT) Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id c85sm1828152wmd.48.2020.04.07.03.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 03:52:07 -0700 (PDT) Date: Tue, 7 Apr 2020 11:52:05 +0100 From: Leif Lindholm To: Daniel Kiper Cc: grub-devel@gnu.org, eschwartz@archlinux.org, floppym@gentoo.org, javierm@redhat.com, olaf@aepfle.de, phcoder@gmail.com, pjones@redhat.com Subject: Re: [PATCH v2 2/4] configure: Enforce gnu99 C language standard Message-ID: <20200407105205.GL14075@vanye> References: <20200403124503.12779-1-daniel.kiper@oracle.com> <20200403124503.12779-3-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403124503.12779-3-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: Tue, 07 Apr 2020 10:52:12 -0000 On Fri, Apr 03, 2020 at 14:45:01 +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 Drop "do not"? > we strongly require a feature from newer C standard. > > Signed-off-by: Daniel Kiper > --- > v2 - suggestions/fixes: > - unconditionally enforce gnu99 C language standard > (suggested by Leif Lindholm). > --- > configure.ac | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/configure.ac b/configure.ac > index b2576b013..fc74ee800 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -80,6 +80,10 @@ if test "x$TARGET_CFLAGS" = x; then > TARGET_CFLAGS=-Os > fi > > +BUILD_CFLAGS="-std=gnu99 $BUILD_CFLAGS" > +HOST_CFLAGS="-std=gnu99 $HOST_CFLAGS" > +TARGET_CFLAGS="-std=gnu99 $TARGET_CFLAGS" Agree with Javier that it would be helpful to explain reason for enforcing gnu99 in a comment. "// Enable support for 'restrict' keyword" Would be enough. / Leif > + > # Default HOST_CPPFLAGS > HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" > HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" > -- > 2.11.0 >