File: charlit.expect

package info (click to toggle)
splint 3.1.2.dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 12,908 kB
  • ctags: 15,816
  • sloc: ansic: 150,306; yacc: 3,463; sh: 3,426; makefile: 2,218; lex: 412
file content (35 lines) | stat: -rw-r--r-- 1,761 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

charlit.c: (in function f)
charlit.c:3:11: Variable x initialized to type char, expects int: 'a'
  A character constant is used as an int. Use +charintliteral to allow
  character constants to be used as ints.  (This is safe since the actual type
  of a char constant is int.)
charlit.c:6:7: Incompatible types for + (int, char): x + 'c'
charlit.c:8:10: Return value type char does not match declared type int: 'a'
charlit.c:12:14: Variable u initialized to type int, expects unsigned int: -3
  To ignore signs in type comparisons use +ignoresigns

Finished checking --- 4 code warnings, as expected

charlit.c: (in function f)
charlit.c:3:11: Variable x initialized to type char, expects int: 'a'
  A character constant is used as an int. Use +charintliteral to allow
  character constants to be used as ints.  (This is safe since the actual type
  of a char constant is int.)
charlit.c:4:14: Variable z initialized to type int, expects double: 3
  An int literal is used as any numeric type (including float and long long).
  Use +numliteral to allow int literals to be used as any numeric type.
charlit.c:6:7: Incompatible types for + (int, char): x + 'c'
charlit.c:8:10: Return value type char does not match declared type int: 'a'
charlit.c:11:18: Initial value of s[1] is type int, expects short int: -1
  To ignore type qualifiers in type comparisons use +ignorequals.
charlit.c:12:14: Variable u initialized to type int, expects unsigned int: -3
  To ignore signs in type comparisons use +ignoresigns

Finished checking --- 6 code warnings, as expected

charlit.c: (in function f)
charlit.c:6:3: Assignment of double to int: x = x + 'c' + 2 + z
  To allow all numeric types to match, use +relaxtypes.

Finished checking --- 1 code warning, as expected