<story><title>Android NDK: GCC is now deprecated, everyone should be switching to Clang</title><url>https://android.googlesource.com/platform/ndk.git/+/master/CHANGELOG.md</url></story><parent_chain><item><author>noobermin</author><text>I&amp;#x27;m not sure if this will stoke a flamewar, because I&amp;#x27;ve never seen a discussion here on this (might just be hanging around different articles). Is there any technical reason to prefer clang over gcc other than ideological reasons? I get the modular nature of llvm is useful, but is the android NDK using this feature?&lt;p&gt;Quick google search shows clang lagging gcc in all but one test[0] at least on Intel Broadwell. Again, what is the benefit other than permissiveness of the license?&lt;p&gt;[0] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.phoronix.com&amp;#x2F;scan.php?page=article&amp;amp;item=clang-gcc-broadwell&amp;amp;num=1&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.phoronix.com&amp;#x2F;scan.php?page=article&amp;amp;item=clang-gcc...&lt;/a&gt;
This is almost a year old, though</text></item></parent_chain><comment><author>kevinchen</author><text>I don&amp;#x27;t know much about Android NDK, but in general, people use clang because:&lt;p&gt;- Clear and readable diagnostics -- especially useful when debugging nasty C++ template stuff where the type signature is a page long. (GCC is catching up in this area)&lt;p&gt;- Modular design -- if an IDE wants to have syntax highlighting or an Xcode&amp;#x2F;Eclipse&amp;#x2F;IntelliJ like &amp;quot;fix it&amp;quot; feature, they can use the clang frontend to parse the code. Also, GCC&amp;#x27;s &amp;quot;big ball of mud&amp;quot; design (iirc they do some optimizations like constant folding in the parser) makes it harder to hack on unless you&amp;#x27;re already pretty familiar with the codebase.&lt;p&gt;- Less hostile community -- people have tried to clean up GCC but their patches were rejected (see the RMS email link below)&lt;p&gt;- Helps you with standards compliance -- clang will still compile code with compiler-specific extensions but it has an option to output a warning. There are some codebases that have come to rely on these behaviors so clang&amp;#x27;s warnings can help make sure you don&amp;#x27;t end up tied to one specific compiler.&lt;p&gt;- Personally, I like AddressSanitizer (ASan). It does similar checks as Valgrind, but using compile-time instrumentation -- just pass in an additional flag. Gets rid of a dependency.</text></comment>
<story><title>Android NDK: GCC is now deprecated, everyone should be switching to Clang</title><url>https://android.googlesource.com/platform/ndk.git/+/master/CHANGELOG.md</url></story><parent_chain><item><author>noobermin</author><text>I&amp;#x27;m not sure if this will stoke a flamewar, because I&amp;#x27;ve never seen a discussion here on this (might just be hanging around different articles). Is there any technical reason to prefer clang over gcc other than ideological reasons? I get the modular nature of llvm is useful, but is the android NDK using this feature?&lt;p&gt;Quick google search shows clang lagging gcc in all but one test[0] at least on Intel Broadwell. Again, what is the benefit other than permissiveness of the license?&lt;p&gt;[0] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.phoronix.com&amp;#x2F;scan.php?page=article&amp;amp;item=clang-gcc-broadwell&amp;amp;num=1&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.phoronix.com&amp;#x2F;scan.php?page=article&amp;amp;item=clang-gcc...&lt;/a&gt;
This is almost a year old, though</text></item></parent_chain><comment><author>rryan</author><text>Here&amp;#x27;s one incredibly awesome feature of Clang: Windows support (thanks to Google, actually).&lt;p&gt;No Cygwin&amp;#x2F;msys required -- it implements the Windows calling conventions, exception handling, etc. You can link modules compiled with Clang using the Microsoft linker.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=dr0eY9c23i8&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=dr0eY9c23i8&lt;/a&gt;</text></comment>