Skip to content

bpo-30459: Use (void) in macros setting variables #28982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2021
Merged

bpo-30459: Use (void) in macros setting variables #28982

merged 1 commit into from
Oct 15, 2021

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 15, 2021

Convert the result of macros setting variables to void to avoid risks
of misusing them:

  • _PyGCHead_SET_NEXT()
  • asdl_seq_SET()
  • asdl_seq_SET_UNTYPED()

https://bugs.python.org/issue30459

Convert the result of macros setting variables to void to avoid risks
of misusing them:

* _PyGCHead_SET_NEXT()
* asdl_seq_SET()
* asdl_seq_SET_UNTYPED()
@vstinner
Copy link
Member Author

There is no need to document these changes, the modified macros are part of the internal C API.

@encukou
Copy link
Member

encukou commented Oct 15, 2021

Did you set the wrong bpo issue? bpo-30459 is "PyList_SET_ITEM could be safer" (and long closed); this has nothing to do with PyList_SET_ITEM.

@vstinner
Copy link
Member Author

vstinner commented Oct 15, 2021

Did you set the wrong bpo issue? bpo-30459 is "PyList_SET_ITEM could be safer" (and long closed); this has nothing to do with PyList_SET_ITEM.

It's the same kind of changes than the PyList_SET_ITEM fix: add (void) prefix. So I refused the same bpo number.

@vstinner vstinner merged commit 51f8196 into python:main Oct 15, 2021
@vstinner vstinner deleted the macro_void branch October 15, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants