From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jKLk1-00024H-23 for mharc-grub-devel@gnu.org; Fri, 03 Apr 2020 08:48:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55635) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKLjx-0001zW-Vi for grub-devel@gnu.org; Fri, 03 Apr 2020 08:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKLjw-00016q-P1 for grub-devel@gnu.org; Fri, 03 Apr 2020 08:48:05 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKLjw-000159-Gc for grub-devel@gnu.org; Fri, 03 Apr 2020 08:48:04 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 033ClaNF119005; Fri, 3 Apr 2020 12:47:48 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=ukXa/tzyB2dUKcT5CaeK4zHdC79DrWKhcnZNOhclJuk=; b=bMwGOBA9FSvmmNL/stUYq2q5gPf+gDG0lVIq936PqAKIc4zLsUMebx7EKhuJGWNvrmbX EzLOw3YLHNb0sG3i60Zaip1K3hhw7/YAhLRQ4obqb6LVUhUGuPASR7qu3XtTuOqt3Ywd TqGbDmQAiZjjT/BKgAHrLgWjZWnL79VK13gFDzTY4A1CPH1suSQVoJ1Gjr2idIrwr/4r muaKQWRoKgCFsRkwmEMRy34RsboL5X36/E1VaOcaZJK478Afngdi411ZgQMbaPJ0mgO/ Q/fLMCNqQ0pGKTiHiDXSNpMJDt7mZ+QqkeRgDHN5wwD2KdnDqdYT+siNzOGZM1Mgt834 Mw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 303yunke53-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 03 Apr 2020 12:47:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 033CgNKd165035; Fri, 3 Apr 2020 12:45:47 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 302g4xe03y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 03 Apr 2020 12:45:47 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 033CjhI8004835; Fri, 3 Apr 2020 12:45:43 GMT Received: from tomti.i.net-space.pl (/10.175.166.95) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Apr 2020 05:45:42 -0700 From: Daniel Kiper To: grub-devel@gnu.org Cc: eschwartz@archlinux.org, floppym@gentoo.org, javierm@redhat.com, leif@nuviainc.com, olaf@aepfle.de, phcoder@gmail.com, pjones@redhat.com Subject: [PATCH v2 2/4] configure: Enforce gnu99 C language standard Date: Fri, 3 Apr 2020 14:45:01 +0200 Message-Id: <20200403124503.12779-3-daniel.kiper@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200403124503.12779-1-daniel.kiper@oracle.com> References: <20200403124503.12779-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 adultscore=0 bulkscore=0 suspectscore=1 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004030112 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9579 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 suspectscore=1 mlxscore=0 spamscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004030113 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 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: Fri, 03 Apr 2020 12:48:07 -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 --- 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" + # Default HOST_CPPFLAGS HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" -- 2.11.0