[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 982a17e02d99dcf6e4dff93110cff5ecc59247f5 by Xiang Zhang in branch '2.7': bpo-30242: resolve some undefined behaviours in struct (#1418) (#1588) https://github.com/python/cpython/commit/982a17e02d99dcf6e4dff93110cff5ecc59247f5 --

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset dd2a09cf98845b1460f0e049ad0ffeeb5c6c6476 by Xiang Zhang in branch '3.5': bpo-30242: resolve some undefined behaviours in struct (#1418) (#1587) https://github.com/python/cpython/commit/dd2a09cf98845b1460f0e049ad0ffeeb5c6c6476 --

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset aad1caf55f7fadb00ee097a1465bece4e128d8ef by Xiang Zhang in branch '3.6': bpo-30242: resolve some undefined behaviours in struct (#1418) (#1586) https://github.com/python/cpython/commit/aad1caf55f7fadb00ee097a1465bece4e128d8ef --

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1681 ___ Python tracker ___ ___

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1680 ___ Python tracker ___ ___

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1679 ___ Python tracker ___ ___

[issue30242] resolve undefined behaviour in struct

2017-05-14 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 981096f98b9c131594b0ac85ad01b63cbd11aa0a by Xiang Zhang in branch 'master': bpo-30242: resolve some undefined behaviours in struct (#1418) https://github.com/python/cpython/commit/981096f98b9c131594b0ac85ad01b63cbd11aa0a --

[issue30242] resolve undefined behaviour in struct

2017-05-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your patch LGTM as a minimal patch for backporting to maintained releases (maybe Mark have other comments). But I think it would be better to make all pointers to raw memory of type unsigned char*. Not just packing, but unpacking too. Using even memcpy

[issue30242] resolve undefined behaviour in struct

2017-05-03 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, do we need to? Currently all pack routines accept a char *p. Converting it to unsigned char * inside could also solve the problem. -- ___ Python tracker

[issue30242] resolve undefined behaviour in struct

2017-05-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I meant changing the type of the first argument of np_ubyte() etc. np_ubyte(unsigned char *p, PyObject *v, const formatdef *f) -- ___ Python tracker

[issue30242] resolve undefined behaviour in struct

2017-05-02 Thread Xiang Zhang
Xiang Zhang added the comment: > I think it is better to change the type of p to unsigned char. Good advice. -- ___ Python tracker ___

[issue30242] resolve undefined behaviour in struct

2017-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is better to change the type of p to unsigned char. -- ___ Python tracker ___

[issue30242] resolve undefined behaviour in struct

2017-05-02 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1524 ___ Python tracker ___ ___

[issue30242] resolve undefined behaviour in struct

2017-05-02 Thread Xiang Zhang
New submission from Xiang Zhang: In struct there are several places using code like: p[--i] = (char)x; to extract the least significant byte from a long. Although this behaviour seems to apply to common implementations but it does not conform to C standard. -- components: Library