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.
This commit is contained in:
Benjamin Peterson 2018-09-11 15:11:06 -07:00 committed by GitHub
parent c4bccd3c76
commit acd282fd5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {