From owner-freebsd-current@FreeBSD.ORG Tue Sep 11 09:07:12 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E13B106566C; Tue, 11 Sep 2012 09:07:12 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id DE7A58FC16; Tue, 11 Sep 2012 09:07:11 +0000 (UTC) Received: from c120.sec.cl.cam.ac.uk (c120.sec.cl.cam.ac.uk [128.232.18.120]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q8B97AX6020121 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 11 Sep 2012 09:07:10 GMT (envelope-from theraven@freebsd.org) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: <504EF3ED.7050502@FreeBSD.org> Date: Tue, 11 Sep 2012 10:07:04 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20120910211207.GC64920@lor.one-eyed-alien.net> <004BADDB-E79D-4497-89EE-641F0359E9BE@FreeBSD.org> <504EF3ED.7050502@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1278) Cc: toolchain@freebsd.org, current@freebsd.org Subject: Re: Clang as default compiler November 4th X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2012 09:07:12 -0000 On 11 Sep 2012, at 09:18, Dimitry Andric wrote: > So I am a bit reluctant to change clang's default standard to c89, > unless clang upstream agrees with this. In the interest of prodding > people to update their software, I would rather have the default stay > c99, personally. :) I'm not proposing changing the default when invoked as clang. When = invoked as clang or clang++, the default remains the same: the latest = version of the standard (which will be C11 and C++11 in clang 3.2). I = am proposing changing the default to be C89 when invoked as cc or c89. Clang upstream is happy with this (I asked on the mailing list at = BSDCan, I just never got around to committing the change) and it also = fixes another bug: clang is always in C99 mode, even when invoked as c89 = or c11. >> Given that POSIX deprecated cc in 1997, I'm quite tempted to say that = we should just remove it entirely and just have c89, c99 and c11 (which = the spec for cc says you should use instead), forcing people to = explicitly select their language dialect, but that's a bikeshed for = another day. >=20 > I think that is a little bit overkill. People who don't care about > standards anyway, will not go through the trouble of setting CC > carefully to 'c89', 'c99' or 'c11'. Most of their software simply > hardcodes "gcc", and must be fixed manually after all. There is some logic in the clang driver already for knowing when it is = invoked as gcc. I'd be quite tempted to make gcc a symlink to clang and = make clang default to gnu89 when invoked in that way. David=