BPO | [38426](https://bugs.python.org/issue38426) --- | :--- Nosy | @vstinner, @serhiy-storchaka, @corona10 PRs | python/cpython#16689 *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = 'https://github.com/corona10' closed_at = created_at = labels = ['interpreter-core', 'type-feature', '3.9'] title = 'declare visit_validate in Py_DEBUG macro' updated_at = user = 'https://github.com/corona10' ``` bugs.python.org fields: ```python activity = actor = 'vstinner' assignee = 'corona10' closed = True closed_date = closer = 'vstinner' components = ['Interpreter Core'] creation = creator = 'corona10' dependencies = [] files = [] hgrepos = [] issue_num = 38426 keywords = ['patch'] message_count = 4.0 messages = ['354313', '354315', '354319', '354324'] nosy_count = 3.0 nosy_names = ['vstinner', 'serhiy.storchaka', 'corona10'] pr_nums = ['16689'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue38426' versions = ['Python 3.9'] ```
Activity
corona10 commentedon Oct 10, 2019
I've got the warining like this.
Modules/gcmodule.c:1925:1: warning: ‘visit_validate’ defined but not used [-Wunused-function]
visit_validate(PyObject *op, void *parent_raw)
This looks like only used in pydebug.
I'd like to propose declaring this function only in #ifdef Py_DEBUG.
My environment is
CentOS Linux release 7.6.1810
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
vstinner commentedon Oct 10, 2019
I wrote PR 16689 to fix the warning. I added the function in bpo-38392.
vstinner commentedon Oct 10, 2019
New changeset a544773 by Victor Stinner in branch 'master':
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
a544773
vstinner commentedon Oct 10, 2019
Thanks for the report. It's now fixed.