From: Benjamin Peterson Date: Tue, 11 Sep 2018 22:11:06 +0000 (-0700) Subject: Initialize a variable to make the compiler happy. (GH-9153) X-Git-Tag: v3.8.0a1~1046 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acd282fd5b3ca4de302b33c9361dbc433593c4ca;p=python 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. --- diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 33ca802fd5..379e860b5b 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -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)) {