Skip to content

Commit acd282f

Browse files
authored
Initialize a variable to make the compiler happy. (GH-9153)
GCC complains: Python/pylifecycle.c: In function ‘_Py_InitializeFromConfig’: Python/pylifecycle.c:900:13: warning: ‘interp’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = _Py_InitializeMainInterpreter(interp, &main_config); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This seems spurious since &interp is passed to _Py_InitializeCore. Anyway, we can easily initialize to quiet the warning.
1 parent c4bccd3 commit acd282f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/pylifecycle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ _Py_InitializeMainInterpreter(PyInterpreterState *interp,
886886
_PyInitError
887887
_Py_InitializeFromConfig(const _PyCoreConfig *config)
888888
{
889-
PyInterpreterState *interp;
889+
PyInterpreterState *interp = NULL;
890890
_PyInitError err;
891891
err = _Py_InitializeCore(&interp, config);
892892
if (_Py_INIT_FAILED(err)) {

0 commit comments

Comments
 (0)