From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE804385DC04; Thu, 17 Aug 2023 18:45:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE804385DC04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692297928; bh=jMma0cgJ3iMQfCk0EY4HrUeDQJRp9KGve5IE2oq1f6Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p2c3mER1PWW/dj4GFzJX5Rv/Q3bcN4spxm5Exmb81nT2XP6CM55NnbsyJvbV0In9d ezqsZ+1ue7Hqqq/BOofhYenCC/0Dn7LKqjUyQAkezEKjkRBP/YrqwaLMyT2vpJXE1G L6IRq6/6XwvXC3m6FcIWmXBewFiBJC5LmKvAFJVE= From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/107646] RFE: can we reimplement gcc-python-plugin's cpychecker as a -fanalyzer plugin? Date: Thu, 17 Aug 2023 18:45:28 +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: dmalcolm at gcc dot gnu.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=3D107646 --- Comment #5 from David Malcolm --- How precisely to track behavior of API entrypoints? We can=E2=80=99t imple= ment known_functions that precisely model every entrypoint. Consider: https://docs.python.org/3/c-api/dict.html#c.PyDict_SetItem which has: Insert val into the dictionary p with a key of key.=20 key must be hashable; if it isn=E2=80=99t, TypeError will be raised.=20 Return 0 on success or -1 on failure.=20 This function does not steal a reference to val. How much of this could be expressed via function attributes, rather than known_function subclasses? List of 20 most commonly used CPython API entrypoints from my 2013 survey: https://fedorapeople.org/~dmalcolm/presentations/PyCon-US-2013/PyCon-US-201= 3-dmalcolm-StaticAnalysis.html#(25)=