gcc/testsuite/gcc.dg/Walloc-size-3.c
raw| 1 | /* PR 112347 |
| 2 | { dg-do compile } |
| 3 | { dg-options "-Walloc-size" } |
| 4 | * */ |
| 5 | |
| 6 | // Test that various types without size do not crash with -Walloc-size |
| 7 | |
| 8 | int * mallocx(unsigned long) __attribute__((malloc)) __attribute__((alloc_size(1))); |
| 9 | void test_oom(void) { void *a_ = mallocx(1); } |
| 10 | |
| 11 | void parse_args(char (**child_args_ptr_ptr)[]) { |
| 12 | *child_args_ptr_ptr = __builtin_calloc(1, sizeof(char)); |
| 13 | } |
| 14 | |
| 15 |