[Python-checkins] cpython: Fix compiler warnings (uninitialized variables), false alarms in fact

victor.stinner python-checkins at python.org
Wed Oct 14 07:42:50 EDT 2015


https://hg.python.org/cpython/rev/4fcc6eb732c4
changeset:   98746:4fcc6eb732c4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Oct 14 12:10:20 2015 +0200
summary:
  Fix compiler warnings (uninitialized variables), false alarms in fact

files:
  Objects/longobject.c |  6 ++----
  1 files changed, 2 insertions(+), 4 deletions(-)


diff --git a/Objects/longobject.c b/Objects/longobject.c
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1587,7 +1587,7 @@
                                 char **bytes_str)
 {
     PyLongObject *scratch, *a;
-    PyObject *str;
+    PyObject *str = NULL;
     Py_ssize_t size, strlen, size_a, i, j;
     digit *pout, *pin, rem, tenpow;
     int negative;
@@ -1664,7 +1664,6 @@
             return -1;
         }
         kind = writer->kind;
-        str = NULL;
     }
     else if (bytes_writer) {
         *bytes_str = _PyBytesWriter_Prepare(bytes_writer, *bytes_str, strlen);
@@ -1777,7 +1776,7 @@
                    _PyBytesWriter *bytes_writer, char **bytes_str)
 {
     PyLongObject *a = (PyLongObject *)aa;
-    PyObject *v;
+    PyObject *v = NULL;
     Py_ssize_t sz;
     Py_ssize_t size_a;
     enum PyUnicode_Kind kind;
@@ -1834,7 +1833,6 @@
         if (_PyUnicodeWriter_Prepare(writer, sz, 'x') == -1)
             return -1;
         kind = writer->kind;
-        v = NULL;
     }
     else if (bytes_writer) {
         *bytes_str = _PyBytesWriter_Prepare(bytes_writer, *bytes_str, sz);

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


More information about the Python-checkins mailing list