5 ms·
While Clang's GCC compatibility is quite good, 12.1% of Debian archive still fails to build with Clang. It is an almost drop-in replacement, but not a drop-in r
by sanxiyn 13y ago
While Clang's GCC compatibility is quite good, 12.1% of Debian archive still fails to build with Clang. It is an almost drop-in replacement, but not a drop-in replacement. http://clang.debian.net/ http://clang.debian.net/
- mitchty 13y agoWhy would it be drop in? The default for clang is c99, for gcc it is still c89, if this was never specified in makefiles you're in for a world of possible hurt. Most "errors" I see on that page amount to boring differences of how the compilers treat C, or how clang doesn't support some random gcc extension, or how clang differs in its interpretation of implementation defined behavior.
- sanxiyn 13y agoI am just pointing this out because some people on this thread are claiming "I have been using Clang for N months and had no problem". I believe them, but it won't necessarily work for you, because Clang is not a drop-in replacement. Clang doesn't need to be a drop-in replacement and I think it shouldn't be, but let the buyers beware.
- mitchty 13y agoGotcha, I just notice most problems seem to be of the "clang interprets the standard this way, therefore it must be wrong because gcc compiles it". I think having multiple different interpretations of undefined behavior a good thing. Means new standards could likely define it. Also shows how much code manages to compile that probably shouldn't. I know i've been surprised with what ambiguous stuff gcc has allowed in my own code.
- pjmlp 13y agoYeah, this is because many tend to confuse their C or C++ compiler accepts with what the ISO/ANSI standard states. Any C or C++ developer doing cross platform development, even if only across UNIX platforms, will have lots of war stories to tell about using different compiler vendors across systems.
- 0x09 13y agoThe statistics on that page do a good job of explaining that in many (most?) of the cases clang will never quite be a drop-in replacement, because the failure is in actuality uncovering a bug in either GCC or the software being compiled. Sylvestre Ledru spent some time on this in particular in his talk at this past FOSDEM[1], taking the above as evidence that clang is now mature enough to support the Debian archive. [1] https://archive.fosdem.org/2013/schedule/event/debian_clang/ https://archive.fosdem.org/2013/schedule/event/debian_clang/