New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile warnings in _pickle.c #69432
Comments
Changeset 88d98f6c2d7d causes compile warnings in Modules/_pickle.c. /home/serhiy/py/cpython/Modules/_pickle.c: In function ‘load_counted_long’:
/home/serhiy/py/cpython/Modules/_pickle.c:4752:15: warning: ‘pdata’ may be used uninitialized in this function [-Wmaybe-uninitialized]
value = _PyLong_FromByteArray((unsigned char *)pdata, (size_t)size,
^
/home/serhiy/py/cpython/Modules/_pickle.c: In function ‘load’:
/home/serhiy/py/cpython/Modules/_pickle.c:5534:24: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized]
idx = Py_CHARMASK(s[0]);
^
/home/serhiy/py/cpython/Modules/_pickle.c:5529:11: note: ‘s’ was declared here
char *s;
^
/home/serhiy/py/cpython/Modules/_pickle.c:4800:7: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized]
x = _PyFloat_Unpack8((unsigned char *)s, 0);
^
/home/serhiy/py/cpython/Modules/_pickle.c:4795:11: note: ‘s’ was declared here
char *s;
^ |
Here are two alternative solutions. |
Why not just initially set *s to NULL in _Unpickler_Read? |
It would be the third variant. The fourth variant is to change the signature of _Unpickler_Read() and return |
New changeset f0dcf7599517 by Benjamin Peterson in branch '3.4': New changeset ef3b833b98c2 by Benjamin Peterson in branch '3.5': New changeset 4d23598f1428 by Benjamin Peterson in branch 'default': |
Okay, I think it might make more sense for |s| to be a return value, but that change probably isn't appropriate for bugfix releases. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: