gcc/testsuite/c-c++-common/analyzer/attr-alloc_size-2.c
raw| 1 | typedef signed long idx_t; |
| 2 | |
| 3 | void *xirealloc (void *p, idx_t s) |
| 4 | __attribute__ ((__alloc_size__ (2))) __attribute__ ((__returns_nonnull__)); |
| 5 | |
| 6 | char * |
| 7 | test_cast_1 (char *buf, idx_t buf_count) |
| 8 | { |
| 9 | return (char *) xirealloc (buf, buf_count + 1); |
| 10 | } |
| 11 | |
| 12 | void *alloc_cast_2 (signed char x, signed char y) |
| 13 | __attribute__ ((__alloc_size__ (1, 2))); |
| 14 | |
| 15 | void * |
| 16 | test_cast_2 (signed char a, signed char b) |
| 17 | { |
| 18 | return alloc_cast_2 (a + 1, b + 1); |
| 19 | } |