https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113634
Bug ID: 113634 Summary: FAIL: gcc.dg/Wfree-nonheap-object-7.c, incorrect declaration for calloc() Product: gcc Version: unknown Status: UNCONFIRMED Keywords: testsuite-fail Severity: normal Priority: P3 Component: testsuite Assignee: unassigned at gcc dot gnu.org Reporter: nightstrike at gmail dot com Target Milestone: --- This test uses an incorrect declaration for calloc(): void *calloc(long, long); whereas the standard requires that it be: void *calloc(size_t, size_t); This can be replaced with: void *calloc(__SIZE_TYPE__, __SIZE_TYPE__); But I'd question why the test doesn't just include stdlib.h. Or, if the intent is to avoid including headers as much as possible, use __builtin_calloc(), which does the right thing. All three of these solutions work (header, builtin, correct declaration).