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.

_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to