• Benjamin Peterson's avatar
    fix marshal uninitialized variable warnings (#4114) · 88d5e2c9
    Benjamin Peterson authored
    GCC says:
    ../cpython/Python/marshal.c: In function ‘PyMarshal_WriteLongToFile’:
    ../cpython/Python/marshal.c:70:35: warning: ‘wf.ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                           else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
                                       ^~
    ../cpython/Python/marshal.c:70:47: warning: ‘wf.end’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                           else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
                                                   ^~
    ../cpython/Python/marshal.c:77:10: warning: ‘wf.str’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (p->str == NULL)
             ~^~~~~
    
    This isn't a real problem because if the file pointer is not NULL, the
    string-related fields are never touched. But, it doesn't hurt to set the unused
    fields to NULL.
    88d5e2c9
marshal.c 38.6 KB