Skip to content
Snippets Groups Projects
Commit ca476474 authored by Richard Smith's avatar Richard Smith
Browse files

Update compatibility page to list some GCC language extensions that Clang does

not support as a possible reason for choosing GCC instead of Clang (and vice
versa). Weaken some of the claimed advantages of Clang in light of GCC
improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196758 91177308-0d34-0410-b5e6-96231b3b80d8
parent 13cd2468
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,14 @@ ...@@ -51,8 +51,14 @@
<li>GCC supports languages that clang does not aim to, such as Java, Ada, <li>GCC supports languages that clang does not aim to, such as Java, Ada,
FORTRAN, etc.</li> FORTRAN, etc.</li>
<li>GCC supports more targets than LLVM.</li> <li>GCC supports more targets than LLVM.</li>
<li>GCC supports many language extensions, some of which are not implemented
by Clang. For instance, in C mode, GCC supports
<a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html">nested
functions</a> and has an
<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37428">undocumented
extension allowing VLAs in structs</a>.
</ul> </ul>
<p>Pro's of clang vs GCC:</p> <p>Pro's of clang vs GCC:</p>
<ul> <ul>
...@@ -81,7 +87,8 @@ ...@@ -81,7 +87,8 @@
GCC does not track information about macro instantiations when parsing GCC does not track information about macro instantiations when parsing
source code. This makes it very difficult for source rewriting tools source code. This makes it very difficult for source rewriting tools
(e.g. for refactoring) to work in the presence of (even simple) (e.g. for refactoring) to work in the presence of (even simple)
macros.</li> macros. This appears to be partially or fully addressed in recent
releases of GCC.</li>
<li>Clang does not implicitly simplify code as it parses it like GCC does. <li>Clang does not implicitly simplify code as it parses it like GCC does.
Doing so causes many problems for source analysis tools: as one simple Doing so causes many problems for source analysis tools: as one simple
example, if you write "x-x" in your source code, the GCC AST will example, if you write "x-x" in your source code, the GCC AST will
...@@ -109,8 +116,12 @@ ...@@ -109,8 +116,12 @@
pluggable optimizers, link-time optimization support, Just-In-Time pluggable optimizers, link-time optimization support, Just-In-Time
compilation, ability to link in multiple code generators, etc.</li> compilation, ability to link in multiple code generators, etc.</li>
<li><a href="compatibility.html#c++">Clang's support for C++</a> is more <li><a href="compatibility.html#c++">Clang's support for C++</a> is more
compliant than GCC's in many ways (e.g. conformant two phase name compliant than GCC's in many ways.</li>
lookup).</li> <li>Clang supports
<a href="http://clang.llvm.org/docs/LanguageExtensions.html">many language
extensions</a>, some of which are not implemented by GCC. For instance,
Clang provides attributes for checking thread safety and extended vector
types.</li>
</ul> </ul>
<!--=====================================================================--> <!--=====================================================================-->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment