3 ms·
This kind of work is valuable even without getting rid of GCC. Each compiler has a slightly different implementation of warnings; getting the code to compile un
by lambda 15y ago
This kind of work is valuable even without getting rid of GCC. Each compiler has a slightly different implementation of warnings; getting the code to compile under two compilers can find issues that you wouldn't find under just one compiler.
It also increases flexibility for developers. Perhaps I prefer to use Clang for its better error messages, or because I find it easier to target at a new platform that I'm working on. If the code already runs under Clang, then that's work I don't have to do. Clang can also be used as an independent parser more easily for GCC, so tools that use it to generate code browsing information or the like benefit from the code already being parseable with Clang.
Compiling under another compiler will also catch more of the cases in which you're depending on non-portable behavior or extensions, which increases the likelihood that you will be able to run it under static analyzers like Coverity, Clang Analyzer, Klee, Splint, or the like.
Basically, beyond wanting to move away from GCC, there is real value in putting work into making sure that everything compiles under another compiler. It's like making sure your web site works on multiple browsers; it can help you catch errors earlier, allow people to use better debugging tools, widen your audience, and help future-proof you.
Now, there are some people who are itching to get away from GCC. For one thing, it is a bigger, older, wartier project, that is harder to work with. People find Clang and LLVM more modular and extensible. For another, there are some companies that are deathly afraid of the GPLv3, and won't touch anything to do with it (Apple in particular, as well as some other embedded device manufacturers I believe). But there are many reasons for wanting to make sure that your software compiles under Clang, and not all of them mean that you want to ditch GCC, just that Clang provides additional value as well.