Fix unintialized pointer warning in Objects/obmalloc.c#15293
Fix unintialized pointer warning in Objects/obmalloc.c#15293hansrajdas wants to merge 1 commit intopython:masterfrom
Conversation
vstinner
left a comment
There was a problem hiding this comment.
This change is useless and would have a big negative impact on performances.
If you want initialized memory, use PyObject_Calloc(), not PyObject_Malloc(). PyObject_Malloc() returns uninitialized memory by design.
I understand that the compiler warnings says that ptr value may be initialized. GCC is wrong: it is always initialized. What is your GCC version? What is your OS? Please open a bug report.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
If you want the compiler bug to be fixed, please open a bug report. But this change is wrong, so I closed the PR. |
|
Thanks @vstinner for your valuable inputs. I am using Ubuntu 18.04.2 LTS and GCC version 7.4.0-1ubuntu1~18.04.1. I will open a bug for this compiler warning. As |
Steps to reproduce, check compilation logs: