aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/attr-malloc-5.c
blob: 7ff4e57fcfbfd4f7d79efbf095b385832db2ca9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* Example of extra argument to "malloc" attribute.  */

struct foo;
extern void foo_release (int, struct foo *);
extern struct foo *foo_acquire (void)
  __attribute__ ((malloc (foo_release, 2)));

void test_1 (void)
{
  struct foo *p = foo_acquire ();
  foo_release (0, p);
}