]> andersk Git - splint.git/blob - test/tests2.2a/bitops.c
Initial revision
[splint.git] / test / tests2.2a / bitops.c
1 int f (int i1, int i2, unsigned u1, unsigned u2)
2 {
3   int x = i1 & i2; /* not unsigned */
4   unsigned u = u1 & i2;
5   short s = i1 & i2;  /* not unsigned */
6   short s2 = i1 + i2;
7
8   u = u1 | u2;
9   u = i1 << 3; /* left operand not unsigned */
10   u = u1 >> 4; /* okay */
11   u = u1 >> i1;
12
13   u >>= 3;
14   u = i1 ^ u1; /* ! unsigned */
15   u = u1 ^ i1; /* ! not unsigned */
16
17   return x;
18 }
19
20 /*
21
22 >>, >>=
23 <<, <<=
24     warn if not unsigned
25
26 &, &=
27 |, |=
28 ^ (XOR), ^=
29    warn if not unsigned
30 */
This page took 0.04671 seconds and 5 git commands to generate.