classification
Title: warning: dereferencing type-punned pointer will break strict-aliasing rules
Type: compile error Stage: patch review
Components: Extension Modules Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: 16113 Superseder:
Assigned To: Nosy List: christian.heimes, mark.dickinson, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-09-13 07:11 by serhiy.storchaka, last changed 2016-09-27 20:35 by serhiy.storchaka.

Files
File name Uploaded Description Edit
keccak_warnings.patch serhiy.storchaka, 2016-09-27 20:35 review
Messages (3)
msg276193 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-13 07:11
In file included from /home/serhiy/py/cpython/Modules/_sha3/sha3module.c:113:0:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function ‘_PySHA3_KeccakP1600_SetBytesInLaneToZero’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:97:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     low = *((UINT32*)(laneAsBytes+0));
     ^
In file included from /home/serhiy/py/cpython/Modules/_sha3/sha3module.c:113:0:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function ‘_PySHA3_KeccakP1600_AddBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:152:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     low = *((UINT32*)(laneAsBytes+0));
     ^
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function ‘_PySHA3_KeccakP1600_ExtractBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:296:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     *((UINT32*)(laneAsBytes+0)) = low;
     ^
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function ‘_PySHA3_KeccakP1600_ExtractAndAddBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:369:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     *((UINT32*)(laneAsBytes+0)) = low;
     ^
msg276210 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2016-09-13 08:15
The compile warning occurs on 32bit builds only: http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.x
msg277546 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-27 20:35
Proposed patch eliminates warnings.
History
Date User Action Args
2016-09-27 20:35:34serhiy.storchakasetfiles: + keccak_warnings.patch
keywords: + patch
messages: + msg277546

stage: needs patch -> patch review
2016-09-13 08:15:15christian.heimessetmessages: + msg276210
2016-09-13 07:17:48christian.heimessetdependencies: + Add SHA-3 and SHAKE (Keccak) support
stage: needs patch
2016-09-13 07:11:54serhiy.storchakacreate