[Python-checkins] cpython: gcc doesn't realize that dummy is always initialized by the function call

gregory.p.smith python-checkins at python.org
Sat Nov 23 21:21:46 CET 2013


http://hg.python.org/cpython/rev/6eca53cf005d
changeset:   87453:6eca53cf005d
user:        Gregory P. Smith <greg at krypto.org>
date:        Sat Nov 23 20:21:28 2013 +0000
summary:
  gcc doesn't realize that dummy is always initialized by the function call
and warns about potential uninitialized use.
Silence that by initializing it to null.

files:
  Modules/_pickle.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/_pickle.c b/Modules/_pickle.c
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1132,7 +1132,7 @@
         (self->frame_end_idx == -1 ||
          self->frame_end_idx <= self->next_read_idx)) {
         /* Need to read new frame */
-        char *dummy;
+        char *dummy = NULL;
         unsigned char *frame_start;
         size_t frame_len;
         if (_Unpickler_ReadUnframed(self, &dummy, FRAME_HEADER_SIZE) < 0)

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


More information about the Python-checkins mailing list