From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C90623858436; Wed, 19 Jul 2023 17:11:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C90623858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689786701; bh=L/0Vt4pEsLOST99DILpzclx72y4KDkeWk2SB505xQT8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QL9dEiRVHh1fzF5dO6jnqISO/kmml6MS+2YtBY0jmH+194ajIQHEy0q+f6NbOLNQb YT0sciUUgCr34b6hYjytXvCN7CKLHwwUkthhVVC2DiaOOznedLvJRCbWxRJAJYdESs bK6HaRV2VldFYDfI+8DTfK4GQ3Uw+UY0r6ZU7sPM= From: "geoffreydgr at icloud dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/109106] GCC Static Analyzer doesn't model printf Date: Wed, 19 Jul 2023 17:11:41 +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: geoffreydgr at icloud dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D109106 --- Comment #5 from Geoffrey --- (In reply to David Malcolm from comment #4) > Thanks for filing this, and for the comments; marking it as a dup of PR > 107017 >=20 > *** This bug has been marked as a duplicate of bug 107017 *** Hi, David. I want to ask a question that does GSA supports printf now? The gcc online docs (https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-fana= lyzer-checker) says that GSA has hardcoded knowledge about the behavior of this function. = But I find that GSA still cannot handle printf (see https://godbolt.org/z/6ooW44sPq). Then I checked the source code, I find th= at you have modeled `sprintf`.=20 I am wondering why GCC static analysis misses `printf`. IMO, it seems straightforward to model. Or actually it is hard to model?=