Skip to content

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

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:macro_void
Oct 15, 2021
Merged

bpo-30459: Use (void) in macros setting variables#28982
vstinner merged 1 commit into
python:mainfrom
vstinner:macro_void

Conversation

@vstinner

@vstinner vstinner commented Oct 15, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@encukou

encukou commented Oct 15, 2021

Copy link
Copy Markdown
Member

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

vstinner commented Oct 15, 2021

Copy link
Copy Markdown
Member Author

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