Difference between revisions of "Clang"

From ArchWiki
Jump to: navigation, search
(Added text to "Using the Static Analyzer" section and added References section)
(update link(s) (avoid redirect))
Line 2: Line 2:
 
[http://clang.llvm.org/ Clang] is a compiler set based on LLVM. It is distributed under BSD Licence.
 
[http://clang.llvm.org/ Clang] is a compiler set based on LLVM. It is distributed under BSD Licence.
 
== Installation ==
 
== Installation ==
Install {{pkg|clang}} form the [[Official Repositories]].
+
Install {{pkg|clang}} form the [[Official repositories]].
  
 
== Build packages with Clang ==
 
== Build packages with Clang ==

Revision as of 12:04, 24 February 2014

Clang is a compiler set based on LLVM. It is distributed under BSD Licence.

Installation

Install clang form the Official repositories.

Build packages with Clang

Add export CC=clang and (for c++) export CXX=clang++ to your /etc/makepkg.conf.

Using the Static Analyzer

First install the clang-analyzer package. To analyze a project, simply place the word scan-build in front of your build command. For example:

$ scan-build make

It is also possible to analyze specific files:

$ scan-build gcc -c t1.c t2.c

References