bpo-37732 : Fix unintialized pointer warning in Objects/obmalloc.c#15309
bpo-37732 : Fix unintialized pointer warning in Objects/obmalloc.c#15309hansrajdas wants to merge 1 commit intopython:masterfrom
Conversation
* Initialize ptr with NULL pointer while declaring
nanjekyejoannah
left a comment
There was a problem hiding this comment.
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