4 ms·
Why 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.
by mitchty 13y ago
Why 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.