From owner-svn-src-head@FreeBSD.ORG Wed Nov 6 07:55:32 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 940DCD8B; Wed, 6 Nov 2013 07:55:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 314D8291B; Wed, 6 Nov 2013 07:55:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::432:d81e:b512:b3] (unknown [IPv6:2001:7b8:3a7:0:432:d81e:b512:b3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BC3F95C43; Wed, 6 Nov 2013 08:55:23 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_6BFB7C6F-9464-4F54-83A1-21954AA0A6C1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: svn commit: r257691 - head/gnu/lib/libgcc From: Dimitry Andric In-Reply-To: <20131106144724.I3234@besplex.bde.org> Date: Wed, 6 Nov 2013 08:55:16 +0100 Message-Id: <38BB8918-1311-4C23-8992-43A272250F05@FreeBSD.org> References: <201311050737.rA57bZkq059529@svn.freebsd.org> <20131105154519.GD65141@onelab2.iet.unipi.it> <20131106144724.I3234@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1816) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2013 07:55:32 -0000 --Apple-Mail=_6BFB7C6F-9464-4F54-83A1-21954AA0A6C1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 06 Nov 2013, at 05:30, Bruce Evans wrote: > On Tue, 5 Nov 2013, Luigi Rizzo wrote: >> On Tue, Nov 05, 2013 at 07:37:35AM +0000, Dimitry Andric wrote: >>> Log: >>> Fix libgcc build with gcc after r257645, by using = -Wno-static-in-inline >>> for clang only. > This still just breaks the warning. See my previous reply. (For gcc, > it is unclear if the missing warning is due too fewer warnings by > default or if it is because gcc's default for plain inline is = different > from clang's so that the code is correct for gcc.). First of all, gcc only emits this warning when using -pedantic, see contrib/gcc/c-typeck.c, around line 2123. However, our copy of gcc also ships with a faulty C99 test in contrib/gcclibs/include/ansidecl.h, which has (around line 176): /* inline requires special treatment; it's in C99, and GCC >=3D2.7 = supports = =20 it too, but it's not in C89. */ = = =20 #undef inline = = =20 #if __STDC_VERSION__ > 199901L = = =20 /* it's a keyword */ = = =20 #else = = =20 # if GCC_VERSION >=3D 2007 = = =20 # define inline __inline__ /* __inline__ prevents -pedantic warnings = */ = =20 # else = = =20 # define inline /* nothing */ = = =20 # endif = = =20 #endif = = =20 Upstream gcc fixed this here: = http://gcc.gnu.org/viewcvs/gcc/trunk/include/ansidecl.h?r1=3D155654&r2=3D1= 55653&pathrev=3D155654 >> I wonder if it is worthwhile adding to the default rules some >> compiler-specific CFLAGS, say CFLAGS_CLANG and CFLAGS_GCC >>=20 >> (there is only a handful of cases now so maybe it is overkill, >> and it harms readability; on the other hand, the Makefiles >> already make a lot of assumptions on variable names) > No, that would further simplify breaking warnings instead of fixing = the > bugs exposed by warnings. The code should be portable so that it = works > with any compiler. That is just not so easy for contrib'ed code = unless > the vendor made it portable. I agree for this particular case, but there are other places in the tree where we must pass either clang-specific or gcc-specific flags. Introducing the variables Luigi suggested makes those Makefiles a little less ugly, at least. > I checked that libgcc is compiled by default with -std=3Dgnu99. This > is just the default from bsd.sys.mk. It is obviously wrong for = libgcc, > since the plain inlines in it require gnu89. Yes, I agree. This can be fixed in libgcc's Makefile, but unfortunately clang will still emit the warning. > gnu99 gives consistenly > broken C99 semantic for both gcc and clang. Only clang warned about > this, and the warning has been broken. Indeed, it always emits the warning, even for -std=3Dgnu89, and even = when __inline__ is explicitly used. This could probably be considered a bug, but I think upstream has meant this as a general warning towards making code C99-compliant. Is it too hard to make a static variable non-static? :) -Dimitry --Apple-Mail=_6BFB7C6F-9464-4F54-83A1-21954AA0A6C1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlJ59egACgkQsF6jCi4glqMJdwCg8LcU1cOJaXrM7CAgmu4Qk2Ug uvQAnRSn724ttJkCOZOL89vm7i0UQiwm =VRbA -----END PGP SIGNATURE----- --Apple-Mail=_6BFB7C6F-9464-4F54-83A1-21954AA0A6C1--