From owner-freebsd-arch@FreeBSD.ORG Sat Mar 7 10:27:32 2009 Return-Path: Delivered-To: arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820F3106564A for ; Sat, 7 Mar 2009 10:27:32 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 468178FC13 for ; Sat, 7 Mar 2009 10:27:31 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n27AVc8K034491 for ; Sat, 7 Mar 2009 05:31:38 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n27AVcDf034490 for arch@FreeBSD.ORG; Sat, 7 Mar 2009 05:31:38 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 7 Mar 2009 05:31:38 -0500 From: David Schultz To: arch@FreeBSD.ORG Message-ID: <20090307103138.GA34456@zim.MIT.EDU> Mail-Followup-To: arch@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: C99 inlines X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2009 10:27:32 -0000 I'd like the gcc in our tree to use the C99 semantics instead of GNU semantics for inline functions in C99 and GNU99 mode. The following patch implements this behavior. It is based on a snapshot of the gcc 4.3 branch from March 2007, prior to the GPLv3 switch. http://www.freebsd.org/~das/c99inline.diff I ran the inline function regression tests from the latest gcc snapshot and fixed two bugs. All the tests pass now, except that programs that bogusly try to instantiate an extern definition of an inline function inside another function cause an ICE. The object files produced by buildworld on amd64 in gnu89 mode are identical with and without this patch (excepting things like OpenSSL that include the compilation time in the binary), so it should be safe for the base system. (One small bugfix in lib/msun and one change in reiserfs are required to make universe without errors.) Ports may be affected if they are compiled with -std=c99 or -std=gnu99 and they're not actually prepared to handle it. The patch also enables some additional error checking (e.g., gcc now complains about inline functions that are declared but never defined), so that could lead to a few build errors. I expect that any port that fails as a result of this patch would fail under gcc 4.3.0 anyway. I'll try to coordinate with portmgr if it looks like there are major issues. What do people think about this?