From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F16793858C27; Thu, 17 Aug 2023 18:53:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F16793858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692298383; bh=q1gUzgNuV01sixBJVDxNnislP88ENP6L3KtHv2f/AzI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xQNORX/S+T4vfGxOW45LhBK4Y2TFdgdg70E3KLGJwygo8oWAHvjWN2k4eMCcrPIJc tqo2X+FLtQG5SxTVyppJ2yt3Y42wd8rltqwIjASFcdQ1DyZEUWcDOcvJ4iAFEUwsED KIWITgb9JpBfs7Z1T6yMBJtSv4w42whdTPFecduk= 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:53:03 +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 #6 from David Malcolm --- (In reply to David Malcolm from comment #5) > How precisely to track behavior of API entrypoints? We can=E2=80=99t imp= lement > known_functions that precisely model every entrypoint. >=20 > Consider: > https://docs.python.org/3/c-api/dict.html#c.PyDict_SetItem Some attribute ideas: extern int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val) __attribute__((cpython_param_must_be_hashable (key)) __attribute__((return_val_on_success (0)) __attribute__((return_val_on_failure (-1)) __attribute__((cpython_param_incremented_on_success (key)) __attribute__((cpython_param_untouched_on_success (val)) ;=