[New-bugs-announce] [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

Anthony Sottile report at bugs.python.org
Fri Mar 29 17:24:56 EDT 2019


New submission from Anthony Sottile <asottile at umich.edu>:

While building python 3.5.7 for https://github.com/deadsnakes

../Modules/_pickle.c: In function 'PyMemoTable_Copy':
../Modules/_pickle.c:677:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < self->mt_allocated; i++) {
     ^
../Modules/_pickle.c:677:5: note: use option -std=c99 or -std=gnu99 to compile your code
../Modules/_pickle.c: In function '_pickle_PicklerMemoProxy_copy_impl':
../Modules/_pickle.c:4207:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < memo->mt_allocated; ++i) {
     ^
../Modules/_pickle.c: In function 'Unpickler_set_memo':
../Modules/_pickle.c:6794:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (size_t i = 0; i < new_memo_size; i++) {
         ^
../Modules/_pickle.c:6842:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
         ^
make[1]: *** [Modules/_pickle.o] Error 1


This cherry-pick caused the regression: https://github.com/python/cpython/commit/ef33dd6036aafbd3f06c1d56e2b1a81dae3da63c

----------
components: Build
messages: 339152
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: backport of pickle fixes to Python 3.5.7 uses C99 for loops
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36478>
_______________________________________


More information about the New-bugs-announce mailing list