From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EBAB33858D3C; Mon, 17 Oct 2022 17:00:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBAB33858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666026020; bh=ze+VZ9QxM34Y/u8UVpIva+6Qt3qtgb+wcRlVqy190K4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xB4WsGgOLIcGQu1V8eV+sD1TX/upyxUVFaoSK4e/oMfS9Jwim471xQcZSRtwUBnfJ lsp1FFTaxJSINrvR5ENfHVVlVGYn+JPp61onWTZ5yRqPH6ejfF9G1cNJQ+T4xkQ6ae tKdMffhBdeeA09Jx+z5HTiT0P2SzcDzxRuoBVvrM= From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/107289] - -Wanayzer-null-dereference false positive with f = *b Date: Mon, 17 Oct 2022 17:00:20 +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: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED 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: bug_status cf_reconfirmed_on everconfirmed 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=3D107289 David Malcolm changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2022-10-17 Ever confirmed|0 |1 --- Comment #2 from David Malcolm --- I believe that the analyzer is considering the case where "d" is (somehow) called from outside of "main", and thus not making the assumption that *b = =3D=3D &a; seeing the compare with NULL, it considers the case that b could be NUL= L. It's not yet clear to me that this case of d being called from outside "mai= n" is valid, or if it's always the case that d can only ever be called from ma= in.=