File: argorder5.c

package info (click to toggle)
lclint 1%3A2.4b-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,996 kB
  • ctags: 9,589
  • sloc: ansic: 100,034; lex: 2,754; yacc: 2,472; makefile: 835
file content (12 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
void test (char *s1, int x);
void test3 (int, char *s1);
void test2 (/*@only@*/ char *s1, int x);
char *copystring (char *s);

int f (/*@only@*/ char *name) /*@modifies *name;@*/
{
  test (name, f(name));  /* 1. Variable name used after being released */
  test3 (f(name), name); /* 2. Variable name used after being released */
  test2 (copystring(name), f(name)); /* 3. Argument 2 modifies *name, used by ... */
  return 3;
}