Re: Clang as default compiler November 4th
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=
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 9 之 86 篇):