Debian Codegraph @

.gitlab/ci/gcc-Wall

raw
1 #!/bin/bash
2 # gcc -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 GCC="gcc${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 # -Wpacked \
18
19 # This does more than expected for gcc (mixed code with declarations)
20 # -Wdeclaration-after-statement \
21
22 EXTRA="-Wextra \
23 -Wsign-compare \
24 -Werror-implicit-function-declaration \
25 -Wpointer-arith \
26 -Wwrite-strings \
27 -Wswitch \
28 -Wmissing-format-attribute \
29 -Wstrict-aliasing=3 \
30 -Winit-self \
31 -Wunsafe-loop-optimizations \
32 -Wold-style-definition \
33 -Wno-missing-field-initializers \
34 -Wunused-parameter \
35 -Wno-long-long \
36 -Wmaybe-uninitialized \
37 -Wvla \
38 -Wformat-overflow \
39 -Wformat-truncation \
40 -Wstringop-overread"
41
42 exec $GCC $PEDANTIC $CONVERSION \
43 -Wall $Wuninitialized \
44 -Wno-switch \
45 -Wdisabled-optimization \
46 -Wwrite-strings \
47 -Wpointer-arith \
48 -Wbad-function-cast \
49 -Wmissing-prototypes \
50 -Wmissing-declarations \
51 -Wstrict-prototypes \
52 -Wnested-externs \
53 -Wcomment \
54 -Winline \
55 -Wcast-align=strict \
56 -Wcast-qual \
57 -Wredundant-decls $EXTRA \
58 "$@"