From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0517B3858C35; Sun, 28 Jan 2024 07:45:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0517B3858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706427925; bh=J4F4vfz42qCWLfTABNmJvGOH+scCa/JUniGZ2HCdJAU=; h=From:To:Subject:Date:From; b=vBAApm8f5aOdeRFpT+LYYPAsM9lP2q/WAgpmqKGCeFqoo2XLkM/YWPFPVp+2MKfoI DjLKvym2G1zBLS6hNgchah/LqWnhaMugDvAi+Oi3V7mvAw5OCN1KG8XyimNmrtq9lI GevjyCysRVmUmB7ucKRdjTcV+lpBEGouAEVWrTXI= From: "nightstrike at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/113634] New: FAIL: gcc.dg/Wfree-nonheap-object-7.c, incorrect declaration for calloc() Date: Sun, 28 Jan 2024 07:45:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: unknown X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: nightstrike at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113634 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 in= tent 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).=