-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-37732 : Fix unintialized pointer warning in Objects/obmalloc.c #15309
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
Conversation
* Initialize ptr with NULL pointer while declaring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had already opened a bpo issue here for this : https://bugs.python.org/issue37732 for someone to investigate. Please link to it in this PR title.
i.e
bpo-37732 : Fix unintialized pointer warning in Objects/obmalloc.c
Thanks @nanjekyejoannah, I will link this PR with opened bpo issue. And also move this PR from draft to open state. |
Why no warning in |
This is because in This is another PR #15293 where Victor suggested that |
And maybe we can resue _PyObject_Malloc in _PyObject_Calloc. |
I dislike this change since it adds an useless initialization to NULL, ptr is already always initialized: GCC is just wrong. I wrote PR #15333 to fix the warning without adding an useless initialization. _PyObject_Malloc() function is performance critical so I would prefer to not make it slower ;-) |
Close: I merged my PR #15333 instead. |
@hansrajdas: but thanks for your contribution anyway ;-) |
https://bugs.python.org/issue37732