]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | |
2 | charlit.c: (in function f) | |
3 | charlit.c:3:11: Variable x initialized to type char, expects int: 'a' | |
4 | A character constant is used as an int. Use +charintliteral to allow | |
5 | character constants to be used as ints. (This is safe since the actual type | |
6 | of a char constant is int.) | |
7 | charlit.c:6:7: Incompatible types for + (int, char): x + 'c' | |
8 | charlit.c:8:10: Return value type char does not match declared type int: 'a' | |
9 | charlit.c:12:14: Variable u initialized to type int, expects unsigned int: -3 | |
10 | To ignore signs in type comparisons use +ignoresigns | |
11 | ||
11db3170 | 12 | Finished checking --- 4 code warnings, as expected |
885824d3 | 13 | |
14 | charlit.c: (in function f) | |
15 | charlit.c:3:11: Variable x initialized to type char, expects int: 'a' | |
16 | A character constant is used as an int. Use +charintliteral to allow | |
17 | character constants to be used as ints. (This is safe since the actual type | |
18 | of a char constant is int.) | |
19 | charlit.c:4:14: Variable z initialized to type int, expects double: 3 | |
20 | An int literal is used as any numeric type (including float and long long). | |
21 | Use +numliteral to allow int literals to be used as any numeric type. | |
22 | charlit.c:6:7: Incompatible types for + (int, char): x + 'c' | |
23 | charlit.c:8:10: Return value type char does not match declared type int: 'a' | |
24 | charlit.c:11:18: Initial value of s[1] is type int, expects short int: -1 | |
25 | To ignore type qualifiers in type comparisons use +ignorequals. | |
26 | charlit.c:12:14: Variable u initialized to type int, expects unsigned int: -3 | |
27 | To ignore signs in type comparisons use +ignoresigns | |
28 | ||
11db3170 | 29 | Finished checking --- 6 code warnings, as expected |
885824d3 | 30 | |
e5081f8c | 31 | charlit.c: (in function f) |
32 | charlit.c:6:3: Assignment of double to int: x = x + 'c' + 2 + z | |
33 | To allow all numeric types to match, use +relaxtypes. | |
34 | ||
35 | Finished checking --- 1 code warning, as expected |