| 1 |
#!/bin/bash |
| 2 |
# clang -Wall plus other important warnings not included in -Wall |
| 3 |
|
| 4 |
for arg in "$@" |
| 5 |
do |
| 6 |
case $arg in |
| 7 |
-O*) Wuninitialized=-Wuninitialized;; # only makes sense with `-O' |
| 8 |
esac |
| 9 |
done |
| 10 |
|
| 11 |
CLANG="clang${COMPILER_VERSION:+-$COMPILER_VERSION}" |
| 12 |
|
| 13 |
#PEDANTIC="-std=gnu99" |
| 14 |
#PEDANTIC="-pedantic -std=gnu99" |
| 15 |
#PEDANTIC="-pedantic -std=gnu99 -Wno-variadic-macros" |
| 16 |
#CONVERSION="-Wconversion" |
| 17 |
|
| 18 |
EXTRA="\ |
| 19 |
-Wextra \ |
| 20 |
-Wsign-compare \ |
| 21 |
-Wcast-align |
| 22 |
-Werror-implicit-function-declaration \ |
| 23 |
-Wpointer-arith \ |
| 24 |
-Wwrite-strings \ |
| 25 |
-Wswitch \ |
| 26 |
-Wmissing-format-attribute \ |
| 27 |
-Winit-self \ |
| 28 |
-Wold-style-definition \ |
| 29 |
-Wno-missing-field-initializers \ |
| 30 |
-Wunused-parameter \ |
| 31 |
-Wno-long-long" |
| 32 |
|
| 33 |
exec $CLANG $PEDANTIC $CONVERSION \ |
| 34 |
-Wall $Wuninitialized \ |
| 35 |
-Wno-switch \ |
| 36 |
-Wdisabled-optimization \ |
| 37 |
-Wwrite-strings \ |
| 38 |
-Wpointer-arith \ |
| 39 |
-Wbad-function-cast \ |
| 40 |
-Wmissing-prototypes \ |
| 41 |
-Wmissing-declarations \ |
| 42 |
-Wstrict-prototypes \ |
| 43 |
-Wnested-externs \ |
| 44 |
-Wcomment \ |
| 45 |
-Winline \ |
| 46 |
-Wcast-qual \ |
| 47 |
-Wredundant-decls $EXTRA \ |
| 48 |
"$@" |