Working on unit tests.
[darkhttpd] / devel / clang-warns
1 #!/bin/sh
2 #
3 # Build with clang with all warnings
4 #
5
6 # Adjust to suit:
7 LLVM=$HOME/llvm
8 CLANG=$LLVM/build/Release/bin/clang
9
10 BDECFLAGS="-W -Wall -pedantic -Wbad-function-cast -Wcast-align \
11 -Wcast-qual -Wchar-subscripts -Winline \
12 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
13 -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
14 # local change: removed -ansi above
15
16 # disabled:
17 # -Wunreachable-code
18
19 $CLANG -std=c99 $BDECFLAGS \
20 -Wextra -Waddress -Waggregate-return \
21 -Wcomment \
22 -Wdisabled-optimization \
23 -Wconversion \
24 -Wempty-body \
25 -Wfloat-equal -Wformat -Wformat=2 \
26 -Wformat-nonliteral \
27 -Wformat-security -Wformat-y2k \
28 -Wignored-qualifiers -Wimplicit \
29 -Winit-self \
30 -Winvalid-pch \
31 -Wlong-long -Wmain \
32 -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute \
33 -Wmissing-include-dirs -Wmissing-noreturn \
34 -Woverlength-strings -Wpacked \
35 -Wpadded -Wparentheses \
36 -Wreturn-type -Wsequence-point -Wsign-compare \
37 -Wstack-protector -Wstrict-aliasing \
38 -Wstrict-overflow -Wstrict-overflow=5 -Wswitch \
39 -Wswitch-default -Wswitch-enum -Wtrigraphs \
40 -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas \
41 -Wunused -Wunused-function -Wunused-label \
42 -Wunused-parameter -Wunused-value -Wunused-variable \
43 -Wvariadic-macros -Wvla -Wvolatile-register-var \
44 -Wabi \
45 -O -pipe -fstrict-aliasing ../darkhttpd.c
46
47 echo errcode: $?
48 rm -f a.out