Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jK1UG-0002JB-3c for mharc-grub-devel@gnu.org; Thu, 02 Apr 2020 11:10:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46727) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK1UC-0002Fb-SK for grub-devel@gnu.org; Thu, 02 Apr 2020 11:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK1UB-00043f-Lm for grub-devel@gnu.org; Thu, 02 Apr 2020 11:10:28 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jK1UB-00043A-DC for grub-devel@gnu.org; Thu, 02 Apr 2020 11:10:27 -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 032F8nGM013889; Thu, 2 Apr 2020 15:10:23 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=z1qbKtjYP8qUc7oWy+pVcBUOODc9bNgON3p442YCFa4=; b=tTud2V58OpQVn4kCofWwX3FZOa8JWVxjecobFYAq3ISWiAy/OKdoYxTtfvTuO+0S23U2 SRlA6/zV3RoguSDI3raxqpakvMfC1GTQTpDeqzIOd+/SISNBfOI6rYC3dq1BsR9Lrtdn 4fLR2wtxuODGIGIuZN6VCHtBffEDilySQ3I+7ZPdASVhPHMDqw4I1pQS+osG0/Bqm/zc 8LDmn7APzc5+nr54wLKAL1MLFyfrJVwZMjkMNFrBqDmu67L5PG8SHlSmfnGvrXMZcY1W KPMH6acZlCxVpWBiImdsqxpYty8QEK67wO7yyvasIuhhjgx+Zfg0S0d2Z2k/VDSmCqcU gQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 303aqhvh0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Apr 2020 15:10:22 +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 032F8Lqf043254; Thu, 2 Apr 2020 15:08:22 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 302ga2kj26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Apr 2020 15:08:22 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 032F8Iwl021364; Thu, 2 Apr 2020 15:08:18 GMT Received: from tomti.i.net-space.pl (/10.175.171.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 02 Apr 2020 08:08:18 -0700 From: Daniel Kiper To: grub-devel@gnu.org Cc: javierm@redhat.com, leif@nuviainc.com, olaf@aepfle.de, phcoder@gmail.com, pjones@redhat.com Subject: [PATCH 1/3] configure: Enforce gnu99 C language standard Date: Thu, 2 Apr 2020 17:07:48 +0200 Message-Id: <20200402150750.6665-2-daniel.kiper@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200402150750.6665-1-daniel.kiper@oracle.com> References: <20200402150750.6665-1-daniel.kiper@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9579 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020131 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9579 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 clxscore=1015 malwarescore=0 impostorscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020131 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 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 15:10:30 -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 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 # Default HOST_CPPFLAGS -- 2.11.0