]> granicus.if.org Git - python/commitdiff
Initialize variables to fix compiler warnings
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 16:06:43 +0000 (17:06 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 16:06:43 +0000 (17:06 +0100)
Warnings seen on the "AMD64 Debian PGO 3.x" buildbot. Warnings are false
positive, but variable initialization should not harm performances.

Modules/_cursesmodule.c
Modules/_pickle.c

index 3bf2ca7ce15392d5c04975a3cb067c73c69b5489..5069285f31e771cc9964d3295f74f762c9bedd26 100644 (file)
@@ -594,7 +594,7 @@ curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y,
     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;
index 46ea2769253e1539bc709089946166d4347ec668..947069afbeb22dac11af1d402b62e43afded7039 100644 (file)
@@ -4762,7 +4762,7 @@ static int
 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 @@ load_unicode(UnpicklerObject *self)
 {
     PyObject *str;
     Py_ssize_t len;
-    char *s;
+    char *s = NULL;
 
     if ((len = _Unpickler_Readline(self, &s)) < 0)
         return -1;
@@ -5732,7 +5732,7 @@ load_put(UnpicklerObject *self)
     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;