Re: Clang as default compiler November 4th

看板FB_current作者時間13年前 (2012/09/11 17:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串9/86 (看更多)
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"
文章代碼(AID): #1GJmKSXS (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1GJmKSXS (FB_current)