[Python-checkins] cpython: Initialize variables to fix compiler warnings

victor.stinner python-checkins at python.org
Fri Dec 9 11:09:10 EST 2016


https://hg.python.org/cpython/rev/4417634f7a30
changeset: 105556:4417634f7a30
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Dec 09 17:06:43 2016 +0100
summary:
 Initialize variables to fix compiler warnings
Warnings seen on the "AMD64 Debian PGO 3.x" buildbot. Warnings are false
positive, but variable initialization should not harm performances.
files:
 Modules/_cursesmodule.c | 2 +-
 Modules/_pickle.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -594,7 +594,7 @@
 int attr_group = group_right_1;
 int rtn;
 int type;
- chtype cch;
+ chtype cch = 0;
 #ifdef HAVE_NCURSESW
 wchar_t wstr[2];
 cchar_t wcval;
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -4762,7 +4762,7 @@
 load_long(UnpicklerObject *self)
 {
 PyObject *value;
- char *s;
+ char *s = NULL;
 Py_ssize_t len;
 
 if ((len = _Unpickler_Readline(self, &s)) < 0)
@@ -4993,7 +4993,7 @@
 {
 PyObject *str;
 Py_ssize_t len;
- char *s;
+ char *s = NULL;
 
 if ((len = _Unpickler_Readline(self, &s)) < 0)
 return -1;
@@ -5732,7 +5732,7 @@
 PyObject *key, *value;
 Py_ssize_t idx;
 Py_ssize_t len;
- char *s;
+ char *s = NULL;
 
 if ((len = _Unpickler_Readline(self, &s)) < 0)
 return -1;
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /