Lines 13-44
gcc_warn_check() {
Link Here
|
13 |
reset_debug=1 |
13 |
reset_debug=1 |
14 |
fi |
14 |
fi |
15 |
local m msgs=( |
15 |
local m msgs=( |
16 |
": warning: dereferencing type-punned pointer will break strict-aliasing rules" |
16 |
# only will and does, no might :) |
17 |
": warning: dereferencing pointer .* does break strict-aliasing rules" |
17 |
"warning: .*will.*\\[-Wstrict-aliasing\\]" |
18 |
": warning: implicit declaration of function" |
18 |
"warning: .*does.*\\[-Wstrict-aliasing\\]" |
19 |
": warning: incompatible implicit declaration of built-in function" |
19 |
# implicit declaration of function ā...ā |
20 |
": warning: is used uninitialized in this function" # we'll ignore "may" and "might" |
20 |
"warning: .*\\[-Wimplicit-function-declaration\\]" |
21 |
": warning: comparisons like X<=Y<=Z do not have their mathematical meaning" |
21 |
# with -Wall, goes in pair with -Wimplicit-function-declaration |
22 |
": warning: null argument where non-null required" |
22 |
# but without -Wall, we need to assert for it alone |
23 |
": warning: array subscript is below array bounds" |
23 |
"warning: .*incompatible implicit declaration of built-in function" |
24 |
": warning: array subscript is above array bounds" |
24 |
# 'is used uninitialized in this function' and some more |
25 |
": warning: attempt to free a non-heap object" |
25 |
"warning: .*\\[-Wuninitialized\\]" |
26 |
": warning: .* called with .*bigger.* than .* destination buffer" |
26 |
# comparisons like āX<=Y<=Zā do not have their mathematical meaning |
27 |
": warning: call to .* will always overflow destination buffer" |
27 |
"warning: .*mathematical meaning*\\[-Wparentheses\\]" |
28 |
": warning: assuming pointer wraparound does not occur when comparing" |
28 |
# null argument where non-null required |
29 |
": warning: hex escape sequence out of range" |
29 |
"warning: .*\\[-Wnonnull\\]" |
30 |
": warning: [^ ]*-hand operand of comma .*has no effect" |
30 |
# array subscript is above/below/outside array bounds |
31 |
": warning: converting to non-pointer type .* from NULL" |
31 |
"warning: .*\\[-Warray-bounds\\]" |
32 |
": warning: NULL used in arithmetic" |
32 |
# attempt to free a non-heap object |
33 |
": warning: passing NULL to non-pointer argument" |
33 |
"warning: .*\\[-Wfree-nonheap-object\\]" |
34 |
": warning: the address of [^ ]* will always evaluate as" |
34 |
# those three do not have matching -W flags, it seems |
35 |
": warning: the address of [^ ]* will never be NULL" |
35 |
"warning: .*will always overflow destination buffer" |
36 |
": warning: too few arguments for format" |
36 |
"warning: .*assuming pointer wraparound does not occur" |
37 |
": warning: reference to local variable .* returned" |
37 |
"warning: .*escape sequence out of range" |
38 |
": warning: returning reference to temporary" |
38 |
# left/right-hand operand of comma expression has no effect |
39 |
": warning: function returns address of local variable" |
39 |
"warning: .*comma.*\\[-Wunused-value\\]" |
40 |
": warning: .*\\[-Wsizeof-pointer-memaccess\\]" |
40 |
# converting to non-pointer type ... from NULL and likes |
41 |
": warning: .*\\[-Waggressive-loop-optimizations\\]" |
41 |
"warning: .*\\[-Wconversion-null\\]" |
|
|
42 |
# NULL used in arithmetic |
43 |
"warning: .*NULL.*\\[-Wpointer-arith\\]" |
44 |
# pointer to a function used in arithmetic and likes |
45 |
"warning: .*function.*\\[-Wpointer-arith\\]" |
46 |
# the address of ... will never be NULL and likes |
47 |
# (uses of function refs & string constants in conditionals) |
48 |
"warning: .*\\[-Waddress\\]" |
49 |
# outdated? |
50 |
"warning: .*too few arguments for format" |
51 |
# format ... expects a matching ... argument |
52 |
# (iow, too few arguments for format in new wording :)) |
53 |
"warning: .*matching.*\\[-Wformat=\\]" |
54 |
# function returns address of local variable |
55 |
"warning: .*\\[-Wreturn-local-addr\\]" |
56 |
# argument to sizeof ... is the same expression as the source |
57 |
"warning: .*\\[-Wsizeof-pointer-memaccess\\]" |
58 |
# iteration invokes undefined behavior |
59 |
"warning: .*\\[-Waggressive-loop-optimizations\\]" |
60 |
|
42 |
# this may be valid code :/ |
61 |
# this may be valid code :/ |
43 |
#": warning: multi-character character constant" |
62 |
#": warning: multi-character character constant" |
44 |
# need to check these two ... |
63 |
# need to check these two ... |
45 |
- |
|
|