Received: from list by lists.gnu.org with archive (Exim 4.71) id 1etgMe-0001aD-9P for mharc-grub-devel@gnu.org; Wed, 07 Mar 2018 16:12:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etgMb-0001a4-Q0 for grub-devel@gnu.org; Wed, 07 Mar 2018 16:12:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etgMW-00067Q-OE for grub-devel@gnu.org; Wed, 07 Mar 2018 16:12:41 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:46704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etgMW-00066Y-EE for grub-devel@gnu.org; Wed, 07 Mar 2018 16:12:36 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w27LC3wa098446; Wed, 7 Mar 2018 21:12:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=YPDP3g/vR1jtlo1i+oR5/ZhEU1ehfCgJnQqxhkkDEfs=; b=ctH3R8xtpqjZ26oAT4ttiVLRW2+dNQcfh9U/cR2BY3nnUlrWxFH5NmtxNsz9gaA/vvA8 TqUU+x5Wt1zHirmH+joc5udPqCNsM+FXDFgni4p7W/HFMYtTvr0evEQpDaWFdDIZCgtx 3Gve42/BQCZBJO+oCH6LCZl7Q4ZKyfxYwNfrIRLTDNQBR8BUGBG62LxzgR1+rYyDby8m rAXmGlY2Wt1qcJd85mX5prj2msld8dp4FHhKNF1gR9VGuI8gETWgm5LUkdlgucHsmswS E54Wns4tqpw81/9ctpnHASOOB//jz8NJiuOrInCRgL5CcVVMbFMJ+nkbjeZRTBFtEh0i UA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2gjqmd81n5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Mar 2018 21:12:33 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w27LCWV7021573 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Mar 2018 21:12:33 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w27LCWZ5001100; Wed, 7 Mar 2018 21:12:32 GMT Received: from olila.local.net-space.pl (/10.175.208.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 07 Mar 2018 13:12:31 -0800 Date: Wed, 7 Mar 2018 22:12:27 +0100 From: Daniel Kiper To: Peter Jones Cc: Eric Snowberg , grub-devel@gnu.org, leif.lindholm@linaro.org Subject: Re: [PATCH] mkimage: fix build regression in grub_mkimage_load_image Message-ID: <20180307211227.GU20614@olila.local.net-space.pl> References: <1520372338-120508-1-git-send-email-eric.snowberg@oracle.com> <20180306222142.tena3hefmzjvmxh5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180306222142.tena3hefmzjvmxh5@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8825 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803070241 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.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 21:12:43 -0000 On Tue, Mar 06, 2018 at 05:22:00PM -0500, Peter Jones wrote: > On Tue, Mar 06, 2018 at 01:38:58PM -0800, Eric Snowberg wrote: > > The grub_mkimage_load_image function (commit 7542af6, mkimage: refactor a bunch > > of section data into a struct.) introduces a build regression on SPARC: > > > > cc1: warnings being treated as errors > > In file included from util/grub-mkimage32.c:23: > > util/grub-mkimagexx.c: In function 'grub_mkimage_load_image32': > > util/grub-mkimagexx.c:1968: error: missing initializer > > util/grub-mkimagexx.c:1968: error: (near initialization for 'smd.sections') > > make[2]: *** [util/grub_mkimage-grub-mkimage32.o] Error 1 > > > > Initialize the entire section_metadata structure. > > I'm not against this fix. Applied as the quick fix. Thanks a lot! > That said, looking at the longer term: how do we have this problem > still? Or: can we please add one of -std={gnu99,gnu11}[0] by default > instead of continuing to "fix" things this way? The C standard has had > this to say about initializer-lists for 19 years now, and even longer in > drafts: > > 19 The initialization shall occur in initializer list order, each > initializer provided for a particular subobject overriding any > previously listed initializer for the same subobject; all subobjects > that are not initialized explicitly shall be initialized implicitly > the same as objects that have static storage duration. > > The compiler most of us use added this functionality when most of us > were in grade school, and the compiler the rest of us use wasn't written > yet when this part of the C standard was. I strongly suspect every > compiler we care about works just fine with that if we just ask it to. > > Can we eliminate having this issue instead of continuing to have to > "fix" the *better* form of this code piecemeal every time someone > forgets we're hobbled in this particular way? Peter, if you could prepare a patch(es) and test it/them on i386, x86_64, ARM (CC Leif?) and SPARC (CC Eric?) then I am happy to get it/them. Thanks, Daniel