Some consistency changes to library & headers flags.
[splint-patched.git] / test / metastate / file.c
bloba9ed1e691ff545dc508eb34c7184ae940ad2c870
1 static void checkOpen (/*@open@*/ /*@null@*/ FILE *);
2 static void checkClosed (/*@closed@*/ /*@null@*/ FILE *);
4 int main (void)
6 FILE *fle = NULL;
7 char s[10];
9 checkClosed (fle); /* okay */
10 checkOpen (fle); /* error */
12 fle = fopen ("test", "r");
13 checkClosed (fle); /* error */
14 checkOpen (fle); /* okay */
17 (void) fclose (fle);
18 checkOpen (fle); /* error */
19 checkClosed (fle); /* okay */
21 return 0; /* error: f is not closed */
26 # if 0
28 @.S
29 (void) fgets (s, 3, fle);
30 (void) fclose (fle);
31 (void) fgets (s, 3, fle); /* error: f is not open */
32 (void) freopen ("test", "r", fle);
33 (void) fgets (s, 3, fle);
34 # endif