Various minor fixes for compiler/linter (other then splint itself) warnings.
[splint-patched.git] / test / shifts.c
blob1f2c13b439688e1d08b4a00101b9e036456d8d08
1 /*@constant int SHIFT_CONST = 5@*/
2 # define SHIFT_CONST 5
4 /*@constant int BAD_CONST = -2@*/
5 # define BAD_CONST -2
7 int f (int i1, unsigned int u1, unsigned int u2)
9 int j1;
10 unsigned int v1, v2;
12 v1 = u1 << i1; /* Right operand may be negative */
13 j1 = i1 << i1; /* Left, right oprands */
15 v2 = u2 << 5;
16 v2 = u2 << SHIFT_CONST;
17 v2 = u2 << BAD_CONST; /* Right operand */
19 return 3;