From: Chris Lattner Pro's of clang vs GCC: Driving Goals and Internal Design:
-
GCC is currently the defacto-standard open source compiler today, and it +routinely compiles a huge volume of code. GCC supports a huge number of +extensions and features (many of which are undocumented) and a lot of +code and header files depend on these features in order to build.
+ +While it would be nice to be able to ignore these extensions and focus on +implementing the language standards to the letter, pragmatics force us to +support the GCC extensions that see the most use. Many users just want their +code to compile, they don't care to argue about whether it is pedantically C99 +or not.
+ +As mentioned above, all +extensions are explicitly recognized as such and marked with extension +diagnostics, which can be mapped to warnings, errors, or just ignored. +
+Our goal is to make it possible for anyone with a basic understanding +of compilers and working knowledge of the C/C++/ObjC languages to understand and +extend the clang source base. A large part of this falls out of our decision to +make the AST mirror the languages as closely as possible: you have your friendly +if statement, for statement, parenthesis expression, structs, unions, etc, all +represented in a simple and explicit way.
+ +In addition to a simple design, we work to make the source base approachable +by commenting it well, including citations of the language standards where +appropriate, and designing the code for simplicity. Beyond that, clang offers +a set of AST dumpers, printers, and visualizers that make it easy to put code in +and see how it is represented.
+We also intend to support "dialects" of these languages, such as C89, K&R C, C++'03, Objective-C 2, etc.
- -GCC is currently the defacto-standard open source compiler today, and it -routinely compiles a huge volume of code. GCC supports a huge number of -extensions and features (many of which are undocumented) and a lot of -code and header files depend on these features in order to build.
- -While it would be nice to be able to ignore these extensions and focus on -implementing the language standards to the letter, pragmatics force us to -support the GCC extensions that see the most use. As mentioned above, all -extensions are explicitly recognized as such and marked with extension -diagnostics, which can be mapped to warnings, errors, or just ignored. -
-