From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B3273858D28; Tue, 11 Apr 2023 09:23:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B3273858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681205035; bh=sQ4LxjjjQ/LyPkwfWT/ZWUViNoFCSdivoU7GfGfN9EM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v6fmUkeLMN52yhfuqZvv8lWIvml5Dg1f9/b8VB72IA3qaiEfqs14WxiE9WRZJi87y QMPvMNPHY/Sy6gFmQdcgYEW6Nto2LrigdSezjeVKS9v8KDwanrHOSO1nK5JnSOczTo jCc83vQusDrQCO7ZtZEHgyz+bdlrTn1rsgmyKRJc= From: "guojiufu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108722] gcc.dg/analyzer/file-CWE-1341-example.c fails on power 9 BE Date: Tue, 11 Apr 2023 09:23:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: guojiufu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc 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=3D108722 Jiu Fu Guo changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guojiufu at gcc dot gnu.org --- Comment #1 from Jiu Fu Guo --- The case only checkes [CWE-1341] which is `double-fclose`. While on the BE machine, besides [CWE-1341], a message of [CWE-415] is also reported. Because attribute `malloc` is attached on fopen: ``` # 258 "/usr/include/stdio.h" 3 4 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes)=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; or say: __attribute_malloc__ __attr_dealloc_fclose __wur; ``` Because this case is not intended to test CWE-415, it may be ok to add -Wno-analyzer-double-free for this case.=