aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-27 09:37:22 +0100
committerMax Kellermann <max@duempel.org>2014-01-27 10:36:48 +0100
commitf29e3ce8d51498799f69dde1e22db4001eb642fe (patch)
tree4f80ef74d6475dc8844945b0966fae12f8d06c19
parentbcb4646d6b3c4ffb80394d13a3bf2fdf15a8de38 (diff)
downloadmpd-f29e3ce8d51498799f69dde1e22db4001eb642fe.tar.gz
mpd-f29e3ce8d51498799f69dde1e22db4001eb642fe.tar.xz
mpd-f29e3ce8d51498799f69dde1e22db4001eb642fe.zip
doc/developer: explain clang static analyzer
Diffstat (limited to '')
-rw-r--r--doc/developer.xml37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/developer.xml b/doc/developer.xml
index 18d6eb724..22a2b9fed 100644
--- a/doc/developer.xml
+++ b/doc/developer.xml
@@ -158,4 +158,41 @@ foo(const char *abc, int xyz)
<email>mpd-devel@musicpd.org</email>
</para>
</chapter>
+
+ <chapter>
+ <title>Development Tools</title>
+
+ <section>
+ <title>Clang Static Analyzer</title>
+
+ <para>
+ The <ulink url="http://clang-analyzer.llvm.org/">clang static
+ analyzer</ulink> is a tool that helps find bugs. To run it on
+ the MPD code base, install LLVM and clang. Configure MPD to
+ use clang:
+ </para>
+
+ <programlisting>./configure --enable-debug CXX=clang++ CC=clang ...</programlisting>
+
+ <para>
+ It is recommended to use <option>--enable-debug</option>,
+ because the analyzer takes advantage of
+ <function>assert()</function> calls, which are only enabled in
+ the debug build.
+ </para>
+
+ <para>
+ Now run the analyzer:
+ </para>
+
+ <programlisting>scan-build --use-c++=clang++ --use-cc=clang make</programlisting>
+
+ <para>
+ The options <option>--use-c++</option> and
+ <option>--use-cc</option> are necessary because it invokes
+ <command>cc</command> for actually compiling the sources by
+ default. That breaks, because MPD requires a C99 compiler.
+ </para>
+ </section>
+ </chapter>
</book>