summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2018-09-11 22:11:06 (GMT)
committerGitHub <noreply@github.com>2018-09-11 22:11:06 (GMT)
commitacd282fd5b3ca4de302b33c9361dbc433593c4ca (patch)
tree672580037e737921e0878130507fab003cf1f363 /Python
parentc4bccd3c7617018b1ce16f95840ffe1a890d44df (diff)
downloadcpython-acd282fd5b3ca4de302b33c9361dbc433593c4ca.zip
cpython-acd282fd5b3ca4de302b33c9361dbc433593c4ca.tar.gz
cpython-acd282fd5b3ca4de302b33c9361dbc433593c4ca.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 33ca802..379e860 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)) {