This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: declare visit_validate in Py_DEBUG macro
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: corona10 Nosy List: corona10, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2019-10-10 05:31 by corona10, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16689 merged vstinner, 2019-10-10 06:50
Messages (4)
msg354313 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2019-10-10 05:31
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)
msg354315 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 06:53
I wrote PR 16689 to fix the warning. I added the function in bpo-38392.
msg354319 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 07:32
New changeset a5447735c334a041ee2ffdeb5c7e13d7d4502ea2 by Victor Stinner in branch 'master':
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
https://github.com/python/cpython/commit/a5447735c334a041ee2ffdeb5c7e13d7d4502ea2
msg354324 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 07:47
Thanks for the report. It's now fixed.
History
Date User Action Args
2022-04-11 14:59:21adminsetgithub: 82607
2019-10-10 07:47:29vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg354324

stage: patch review -> resolved
2019-10-10 07:32:19vstinnersetmessages: + msg354319
2019-10-10 06:53:34vstinnersetmessages: + msg354315
2019-10-10 06:50:59vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request16276
2019-10-10 05:31:15corona10create