| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-std=gnu17" } */ |
| 3 |
/* { dg-prune-output "\\\[-Wbuiltin-declaration-mismatch" } */ |
| 4 |
|
| 5 |
void *ext2fs_resize_mem_p; |
| 6 |
struct ext2_icount_el { |
| 7 |
int ino; |
| 8 |
} * insert_icount_el_icount_1; |
| 9 |
int insert_icount_el_icount, insert_icount_el_new_size; |
| 10 |
void *memcpy(); |
| 11 |
void *realloc(); |
| 12 |
int ext2fs_resize_mem(void *p1) { |
| 13 |
int size = 0; |
| 14 |
memcpy(&ext2fs_resize_mem_p, p1, sizeof(ext2fs_resize_mem_p)); |
| 15 |
void *p = realloc(&ext2fs_resize_mem_p, size); |
| 16 |
return 0; |
| 17 |
} |
| 18 |
struct ext2_icount_el *insert_icount_el() { |
| 19 |
if (insert_icount_el_icount) |
| 20 |
insert_icount_el_new_size = insert_icount_el_icount_1[0].ino; |
| 21 |
ext2fs_resize_mem(&insert_icount_el_icount_1); |
| 22 |
return 0; |
| 23 |
} |
| 24 |
|
| 25 |
/* Passing the address of a declared object to realloc triggers |
| 26 |
-Wfree-nonheap-object unless -flto is used. |
| 27 |
{ dg-prune-output "\\\[-Wfree-nonheap-object" } */ |