Some consistency changes to library & headers flags.
[splint-patched.git] / test / specclauses5.c
blob25a168dcdb9c1de79898e2f797e3b4680c6bd6d1
1 /*@-paramuse@*/
3 typedef struct
5 int id;
6 char *name;
7 } *record;
9 /*@special@*/ record newrecord (void)
10 /*@defines result@*/
11 /*@post:isnull result->name@*/
13 record r = (record) malloc (sizeof (*r));
15 assert (r != NULL);
16 r->id = 3;
17 r->name = NULL;
18 return r;
21 record createrecord (/*@only@*/ char *name)
23 record r = newrecord ();
24 r->name = name;
25 return r;
28 record createrecord2 (void)
30 record r = newrecord ();
31 return r; /* 1. Null storage r->name derivable from return value: r */
34 /*@special@*/ record newrecord2 (void)
35 /*@defines *result@*/
36 /*@post:observer result->name@*/
38 record r = (record) malloc (sizeof (*r));
40 assert (r != NULL);
41 r->id = 3;
42 r->name = NULL;
43 return r; /* 2. Non-observer storage r->name corresponds to storage ... */
46 record createrecordx (void)
48 record r = newrecord2 ();
49 return r; /* 3. Observer storage r->name reachable from observer return */