
Originally Posted by
elanthis
One of the single biggest avantages of Clang is that it is a library, not a program (though it obviously ships with a program that uses the library to provide a complete compiler). Clang as a library makes all kinds of stuff possible that GCC does not. One of the most interesting (and one that Apple is quite interested in) is the ability to use the compiler for code completion and static analysis inside of an IDE (e.g. XCode). The alternatives now pretty much come down to etags (which is a piece of shit, it can't even complete on local variables), incredibly incomplete half-assed parsers that will barf on any moderately interesting use of templates, or simple regex machines that can barely do what etags does. The only interesting alternative that has appeared that even comes close to what Clang can offer for completion is KDevelop's duchains, which are brand spanking new and GPLv3'd (making them totally unsuitable as a library to most corporations). GCC cannot be used as a library, the FSF and RMS refuse to let it be a library, and even the plugin system (which does not provide all of the advantages that GCC-as-a-library would have provided, and which are needed) took years to get approved and a ton of legal wrangling and probably required a gun to be held to RMS' head to get approved.