From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 417FE38754A1; Wed, 15 May 2024 07:16:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 417FE38754A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715757403; bh=WioX2JeyL1ZHGlaT5RB4YTEWzKqw0+Uha1xQXy2BozQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cmUxbt9ElBgXkZulhUj9uKY8QKpwW+d/2WwQ4X21v7jDMtGTSktY2v8XFcc0doqXq MKN9VskHUxBGLfdMK/RAZxy+0ufSBIV8DDtSFVJcSu/LY+LuhKdnKwXAUzUZ6OU4g1 XkpF+ESnuv4EhjBm5D+vZ//Q6tKqPOuFef/tvMlM= From: "alx at kernel dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/109335] -Wanalyzer-malloc-leak false positives and false negatives Date: Wed, 15 May 2024 07:16:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alx at kernel dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm 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=3D109335 --- Comment #2 from Alejandro Colomar --- This is probably because there's no way to mark a function as being a valid deallocator (i.e., the converse of [[gnu::malloc()]]). As a workaround, such deallocators could be defined (C99) inline, so that t= he analyzer can see that they are internally calling the actual deallocator, b= ut that's hard when the deallocator is in a library, which might support C89, = as is probably the case in libbsd.=