From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jYq72-00072K-VQ for mharc-grub-devel@gnu.org; Wed, 13 May 2020 08:03:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYq6z-0006xR-RJ for grub-devel@gnu.org; Wed, 13 May 2020 08:03:45 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYq6y-0007iK-HW for grub-devel@gnu.org; Wed, 13 May 2020 08:03:45 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04DC3GA1061289; Wed, 13 May 2020 12:03:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2020-01-29; bh=dmE5TN3v1c06PMOgIuy+XiJmly1fh7JoU4Ae+1k+90w=; b=AITs78y5MCNJrveh6HkmwDsOJBaK6UL1ADwEFWveH6zolocQ5dNcOEo5btf9Rbc0uq9v 9cm+FmijKZA46bYufDsSJia/UzMP2w/XGGjwCuY6VJrp3+OIcGgfcXXhWsqZZRQx8/2K jxGdVp7u3TvoIkbvKzhL9kwXdNYQlV5LZrLUAQ/IvkygHr2WJzrRjRgvilHgpXtwJ+Me doKYb23xqWFrwOOdV+iKZwdf/r5KOH2vrh72XP0opooZtKikew6xg7qk9HbeWGkvJxcT Ox3cpEccTywJIv+rt5jcF4+ZevGfvG5L7aYBqJUd0lIvzxw1CfW+hc/U1A0xgQ48sQlX pA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 3100xwkqp2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 13 May 2020 12:03:24 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04DBwVVQ066275; Wed, 13 May 2020 12:03:24 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 3100ykxw6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 May 2020 12:03:24 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04DC3J0u019566; Wed, 13 May 2020 12:03:19 GMT Received: from tomti.i.net-space.pl (/10.175.212.163) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 13 May 2020 05:03:19 -0700 From: Daniel Kiper To: grub-devel@gnu.org Cc: eschwartz@archlinux.org, floppym@gentoo.org, glaubitz@physik.fu-berlin.de, javierm@redhat.com, leif@nuviainc.com, olaf@aepfle.de, phcoder@gmail.com, pjones@redhat.com Subject: [PATCH v3 2/5] configure: Set gnu99 C language standard by default Date: Wed, 13 May 2020 14:02:48 +0200 Message-Id: <20200513120251.9861-3-daniel.kiper@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200513120251.9861-1-daniel.kiper@oracle.com> References: <20200513120251.9861-1-daniel.kiper@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9619 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 suspectscore=1 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005130109 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9619 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 cotscore=-2147483648 bulkscore=0 phishscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 spamscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 suspectscore=1 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005130109 Received-SPF: pass client-ip=156.151.31.85; envelope-from=daniel.kiper@oracle.com; helo=userp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/13 08:03:43 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: Wed, 13 May 2020 12:03:46 -0000 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 set gnu99 C language standard for all compilers by default. 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 discover that we strongly require a feature from newer C standard. The user is still able to override C language standard using relevant *_CFLAGS variables. Signed-off-by: Daniel Kiper --- v3 - suggestions/fixes: - add a comment before the change in configure.ac (suggested by Javier Martinez Canillas and Leif Lindholm), - improve commit message (suggested by Javier Martinez Canillas and Leif Lindholm). v2 - suggestions/fixes: - unconditionally enforce gnu99 C language standard (suggested by Leif Lindholm). --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index b2576b013..3eda9a5a2 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,12 @@ if test "x$TARGET_CFLAGS" = x; then TARGET_CFLAGS=-Os fi +# Enable support for "restrict" keyword and other +# features from gnu99 C language standard. +BUILD_CFLAGS="-std=gnu99 $BUILD_CFLAGS" +HOST_CFLAGS="-std=gnu99 $HOST_CFLAGS" +TARGET_CFLAGS="-std=gnu99 $TARGET_CFLAGS" + # Default HOST_CPPFLAGS HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" -- 2.11.0