Re: Clang as default compiler November 4th

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 11 Sep 2012 10:18:53 +0200
On 2012-09-11 09:58, David Chisnall wrote:
> Clang should default to c89 mode when invoked as cc.  I had a patch to do this, but I seem to have misplaced it.  I'll try to find or rewrite it in the next couple of days.
>
> A lot of the ports failures I saw were due to ports using cc as the default C compiler (autoconf seems to select it) and then using GNU89 inlining rules, so that they died with linker failures.

Yes, this happens a lot, even with relatively new software.  Though I
don't see why we couldn't just add -std=gnu89 by default in bsd.port.mk,
if no CSTD= setting is specified.  This should work for any version of
clang, or any other compilers that don't default to gnu89.

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. :)


> 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.

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.
Received on Tue Sep 11 2012 - 06:18:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:30 UTC