I am working on a fix already.
pythongh-105673: Fix `‘value’ may be used uninitialized in this funct…
Better output (greppable and more precise):
-o Python/sysmodule.o ./Python/sysmodule.c ./Python/sysmodule.c:3390:13: warning: variable 'value' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (name == NULL) { ^~~~~~~~~~~~ ./Python/sysmodule.c:3407:16: note: uninitialized use occurs here Py_XDECREF(value); ^~~~~ ./Include/object.h:792:52: note: expanded from macro 'Py_XDECREF' # define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op)) ^~ ./Include/object.h:178:49: note: expanded from macro '_PyObject_CAST' #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op)) ^~ ./Include/pyport.h:24:38: note: expanded from macro '_Py_CAST' #define _Py_CAST(type, expr) ((type)(expr)) ^~~~ ./Python/sysmodule.c:3390:9: note: remove the 'if' if its condition is always false if (name == NULL) { ^~~~~~~~~~~~~~~~~~~ ./Python/sysmodule.c:3383:13: warning: variable 'value' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (name == NULL) { ^~~~~~~~~~~~ ./Python/sysmodule.c:3407:16: note: uninitialized use occurs here Py_XDECREF(value); ^~~~~ ./Include/object.h:792:52: note: expanded from macro 'Py_XDECREF' # define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op)) ^~ ./Include/object.h:178:49: note: expanded from macro '_PyObject_CAST' #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op)) ^~ ./Include/pyport.h:24:38: note: expanded from macro '_Py_CAST' #define _Py_CAST(type, expr) ((type)(expr)) ^~~~ ./Python/sysmodule.c:3383:9: note: remove the 'if' if its condition is always false if (name == NULL) { ^~~~~~~~~~~~~~~~~~~ ./Python/sysmodule.c:3378:27: note: initialize the variable 'value' to silence this warning PyObject *name, *value; ^ = NULL
gh-105673: Fix uninitialized warning in sysmodule.c (#105674)
pythongh-105673: Fix uninitialized warning in sysmodule.c (pythonGH-1…
[3.11] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (
[3.12] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (
Activity
pythongh-105673: Fix `‘value’ may be used uninitialized in this funct…
sobolevn commented on Jun 12, 2023
Better output (greppable and more precise):
-o Python/sysmodule.o ./Python/sysmodule.c ./Python/sysmodule.c:3390:13: warning: variable 'value' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (name == NULL) { ^~~~~~~~~~~~ ./Python/sysmodule.c:3407:16: note: uninitialized use occurs here Py_XDECREF(value); ^~~~~ ./Include/object.h:792:52: note: expanded from macro 'Py_XDECREF' # define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op)) ^~ ./Include/object.h:178:49: note: expanded from macro '_PyObject_CAST' #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op)) ^~ ./Include/pyport.h:24:38: note: expanded from macro '_Py_CAST' #define _Py_CAST(type, expr) ((type)(expr)) ^~~~ ./Python/sysmodule.c:3390:9: note: remove the 'if' if its condition is always false if (name == NULL) { ^~~~~~~~~~~~~~~~~~~ ./Python/sysmodule.c:3383:13: warning: variable 'value' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (name == NULL) { ^~~~~~~~~~~~ ./Python/sysmodule.c:3407:16: note: uninitialized use occurs here Py_XDECREF(value); ^~~~~ ./Include/object.h:792:52: note: expanded from macro 'Py_XDECREF' # define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op)) ^~ ./Include/object.h:178:49: note: expanded from macro '_PyObject_CAST' #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op)) ^~ ./Include/pyport.h:24:38: note: expanded from macro '_Py_CAST' #define _Py_CAST(type, expr) ((type)(expr)) ^~~~ ./Python/sysmodule.c:3383:9: note: remove the 'if' if its condition is always false if (name == NULL) { ^~~~~~~~~~~~~~~~~~~ ./Python/sysmodule.c:3378:27: note: initialize the variable 'value' to silence this warning PyObject *name, *value; ^ = NULLgh-105673: Fix uninitialized warning in sysmodule.c (#105674)
pythongh-105673: Fix uninitialized warning in sysmodule.c (pythonGH-1…
pythongh-105673: Fix uninitialized warning in sysmodule.c (pythonGH-1…
[3.11] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (
[3.12] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (