Imported Upstream version 2.6.1
[platform/upstream/cryptsetup.git] / .gitlab / ci / gcc-Wall
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  -Wno-unused-parameter \
35  -Wno-long-long \
36  -Wmaybe-uninitialized \
37  -Wvla \
38  -Wformat-overflow \
39  -Wformat-truncation"
40
41 exec $GCC $PEDANTIC $CONVERSION \
42         -Wall $Wuninitialized \
43         -Wno-switch \
44         -Wdisabled-optimization \
45         -Wwrite-strings \
46         -Wpointer-arith \
47         -Wbad-function-cast \
48         -Wmissing-prototypes \
49         -Wmissing-declarations \
50         -Wstrict-prototypes \
51         -Wnested-externs \
52         -Wcomment \
53         -Winline \
54         -Wcast-align=strict \
55         -Wcast-qual \
56         -Wredundant-decls $EXTRA \
57         "$@"