]> andersk Git - splint.git/blob - test/tests2.2/arbints.c
Renamed lclintMacros.nf splintMacros.nf
[splint.git] / test / tests2.2 / arbints.c
1 typedef /*@integraltype@*/ a_int;
2 typedef /*@unsignedintegraltype@*/ u_int;
3 typedef /*@signedintegraltype@*/ s_int;
4
5 int f (a_int a, u_int u, s_int s)
6 {
7   unsigned long ul;
8   long l;
9   
10   printf ("the values are: %d %ld %ud", a, u, s); /* expect 3 errors */
11   ul = a; /* Assignment of a_int to unsigned long int: ul = a */
12
13   /*@+longunsignedintegral@*/
14   ul = a;
15
16   /*@+longintegral@*/
17   ul = a;
18
19   if (u == a) printf ("yo!");
20
21   /*@+matchanyintegral@*/
22   if (u == l) printf ("yo!");
23   if (u == a) printf ("yo!");
24   /*@=matchanyintegral@*/
25
26   /*@+longsignedintegral@*/
27   printf ("i'm okay: %ld", s);
28
29   /*@+longunsignedunsignedintegral@*/
30   printf ("you're not! %ld", u);
31   printf ("you're not! %ud", u);
32
33   return a;
34 }
This page took 0.039264 seconds and 5 git commands to generate.