]> git.xonotic.org Git - xonotic/gmqcc.git/blob - splint.sh
Added splint.sh (a progressive way to fix some possible bugs)
[xonotic/gmqcc.git] / splint.sh
1 #!/bin/sh
2
3 #these are stupid flags ... i.e to inhibit warnings that are just stupid
4 FLAGS_STUPID="\
5     -redef               \
6     -noeffect            \
7     -nullderef           \
8     -usedef              \
9     -type                \
10     -mustfreeonly        \
11     -nullstate           \
12     -varuse              \
13     -mustfreefresh       \
14     -compdestroy         \
15     -compmempass         \
16     -nullpass            \
17     -onlytrans           \
18     -predboolint         \
19     -boolops             \
20     -exportlocal         \
21     -retvalint           \
22     -nullret             \
23     -predboolothers      \
24     -globstate           \
25     -dependenttrans      \
26     -branchstate         \
27     -compdef             \
28     -temptrans           \
29     -usereleased         \
30     -warnposix"
31
32 #flags that have no place anywhere else
33 #mostly stupid
34 FLAGS_OTHERS="\
35     -shiftimplementation \
36     +charindex           \
37     -kepttrans           \
38     -unqualifiedtrans    \
39     +matchanyintegral    \
40     -bufferoverflowhigh  \
41     +voidabstract"
42
43 #these are flags that MAYBE shouldn't be required
44 # -nullassign should be surpressed in code with /*@null*/
45 # (although that might be odd?)
46 FLAGS_MAYBE="\
47     -nullassign          \
48     -unrecog             \
49     -casebreak           \
50     -retvalbool          \
51     -retvalother         \
52     -mayaliasunique      \
53     -realcompare         \
54     -observertrans       \
55     -noret               \
56     -shiftnegative       \
57     -exitarg             \
58     -freshtrans          \
59     -abstract            \
60     -statictrans"
61
62 #these are flags that shouldn't be required. I.e tofix in code so that
63 #these don't need to be here to onhibit the warning
64 # remove one flag from here at a time while fixing the code so that
65 FLAGS_TOFIX="\
66     -boolcompare         \
67     -formatconst         \
68     -unreachable         \
69     -incondefs           \
70     -initallelements     \
71     -macroredef          \
72     -castfcnptr          \
73     -evalorder"
74
75
76 splint $FLAGS_STUPID $FLAGS_MAYBE $FLAGS_TOFIX $FLAGS_OTHERS *.c *.h