From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26D6A385828D; Fri, 3 Nov 2023 17:27:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26D6A385828D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699032433; bh=LG6tr8fW96/lzNeDZTwnCpDMxS6sVgH3Hfj2up7p1hg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RTqSImh9Y3LWTp0yVOvF3u0SClWqFg9THa/1BwsXfw21C9lDNaUjyMGAhMf066rgg EUepW6OVX2oddVgYO8cyIwFCK2Mqhi9lFdN4++vZYOM1Y3GndTxtmtg26vWAmpmhWH CRgXO6WVydYU+uNnaVB4broKAUeM+ENwPrNyIdaQ= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/112364] calloc used incorrectly Date: Fri, 03 Nov 2023 17:27:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: build, diagnostic, easyhack, internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D112364 --- Comment #11 from Martin Uecker --- This is one possible way to read it. But as written, I think one can easily understand it the other way, because calloc never mentions requested total = size but only about space for an array of objects of size 'size'. And then also 7.24.3 continues with "It may then be used to access such an object or an a= rray of such objects.." which would also imply that the "size" in the sentence before refers to the size of an individual object. Anyway, I think it does not really matter for us... IMHO it is still usefu= l to make the code have the logical order as documented for calloc. And if it tu= rns out that the warning annoys too many people in this way, we can still tweak= it before the release.=