[Python-checkins] cpython (merge 3.4 -> default): Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).

antoine.pitrou python-checkins at python.org
Tue May 19 21:07:36 CEST 2015


https://hg.python.org/cpython/rev/f3dbeca1e30d
changeset:   96162:f3dbeca1e30d
parent:      96160:06fab9093973
parent:      96161:f3d2cfc4f2ab
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Tue May 19 21:06:04 2015 +0200
summary:
  Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).

files:
  Objects/unicodeobject.c |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3530,6 +3530,7 @@
     return unicode;
 
 decode_error:
+    reason = NULL;
     errmsg = strerror(errno);
     assert(errmsg != NULL);
 
@@ -3540,10 +3541,9 @@
         if (wstr != NULL) {
             reason = PyUnicode_FromWideChar(wstr, errlen);
             PyMem_RawFree(wstr);
-        } else
-            errmsg = NULL;
-    }
-    if (errmsg == NULL)
+        }
+    }
+    if (reason == NULL)
         reason = PyUnicode_FromString(
             "mbstowcs() encountered an invalid multibyte sequence");
     if (reason == NULL)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list