Commit acd282fd authored by Benjamin Peterson's avatar Benjamin Peterson Committed by GitHub

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.
parent c4bccd3c
......@@ -886,7 +886,7 @@ _Py_InitializeMainInterpreter(PyInterpreterState *interp,
_PyInitError
_Py_InitializeFromConfig(const _PyCoreConfig *config)
{
PyInterpreterState *interp;
PyInterpreterState *interp = NULL;
_PyInitError err;
err = _Py_InitializeCore(&interp, config);
if (_Py_INIT_FAILED(err)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment