From owner-svn-src-head@FreeBSD.ORG Wed Nov 6 04:30:53 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 466091EC; Wed, 6 Nov 2013 04:30:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0374920AC; Wed, 6 Nov 2013 04:30:52 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 8DFFED617CE; Wed, 6 Nov 2013 15:30:42 +1100 (EST) Date: Wed, 6 Nov 2013 15:30:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Luigi Rizzo Subject: Re: svn commit: r257691 - head/gnu/lib/libgcc In-Reply-To: <20131105154519.GD65141@onelab2.iet.unipi.it> Message-ID: <20131106144724.I3234@besplex.bde.org> References: <201311050737.rA57bZkq059529@svn.freebsd.org> <20131105154519.GD65141@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=cCbrWYaO2fIA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=O6xDf_UZitYA:10 a=lfqv2VCxg68aSHk5MQEA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric 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 04:30:53 -0000 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.). > I wonder if it is worthwhile adding to the default rules some > compiler-specific CFLAGS, say CFLAGS_CLANG and CFLAGS_GCC > > (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 checked that libgcc is compiled by default with -std=gnu99. This is just the default from bsd.sys.mk. It is obviously wrong for libgcc, since the plain inlines in it require gnu89. gnu99 gives consistenly broken C99 semantic for both gcc and clang. Only clang warned about this, and the warning has been broken. Contribed code could easily depend on either newer or older standards than the one is defaulted. gcc should be more portable than most contribed code, especially in parts required to bootstrap itself. It seems to never use extern inline, but that means that all of its uses of plain inline assume gnu89 and are thus unportable to pre-c99 compilers other than itself and to post-c99 compilers including itself. Maybe its own autoconfigued makefiles avoid this problem by forcing -std=gnu89 or by avoiding -std=c99. Or -Dinline= might work for bootstrapping. Bruce