We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug gcc10 has new strict aliasing warnings not raised in gcc9.
To Reproduce
> CC=gcc10 make zstd ../lib/compress/zstd_compress.c: In function ‘ZSTD_loadCEntropy’: ../lib/compress/zstd_compress.c:2923:64: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 2923 | size_t const hufHeaderSize = HUF_readCTable((HUF_CElt*)bs->entropy.huf.CTable, &maxSymbolValue, dictPtr, | ^~ ../lib/compress/zstd_compress_literals.c: In function ‘ZSTD_compressLiterals’: ../lib/compress/zstd_compress_literals.c:108:28: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 108 | (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2) : | ^~~~~~~ ../lib/compress/zstd_compress_literals.c:112:28: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 112 | (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2); | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c: In function ‘ZSTD_buildSuperBlockEntropy_literal’: ../lib/compress/zstd_compress_superblock.c:116:76: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 116 | if (repeat == HUF_repeat_check && !HUF_validateCTable((HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue)) { | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c:123:64: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 123 | { size_t const maxBits = HUF_buildCTable_wksp((HUF_CElt*)nextHuf->CTable, countWksp, | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c:130:32: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 130 | (HUF_CElt*)nextHuf->CTable, countWksp, maxSymbolValue); | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c:133:32: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 133 | (HUF_CElt*)nextHuf->CTable, maxSymbolValue, huffLog); | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c:137:42: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 137 | (HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue); | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c: In function ‘ZSTD_compressSubBlock’: ../lib/compress/zstd_compress_superblock.c:553:74: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 553 | { size_t cLitSize = ZSTD_compressSubBlock_literal((const HUF_CElt*)entropy->huf.CTable, | ^~~~~~~ ../lib/compress/zstd_compress_superblock.c: In function ‘ZSTD_estimateSubBlockSize_literal’: ../lib/compress/zstd_compress_superblock.c:594:83: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 594 | { size_t cLitSizeEstimate = HUF_estimateCompressedSize((const HUF_CElt*)huf->CTable, countWksp, maxSymbolValue); |
Expected behavior No warnings
Desktop (please complete the following information):
gcc10
The text was updated successfully, but these errors were encountered:
main/zstd: fix build wih gcc10
3504242
add -fno-strict-aliasing so it builds with gcc 10. upstream report: facebook/zstd#2204
Fixed by PR #2415
Sorry, something went wrong.
No branches or pull requests
Describe the bug
gcc10 has new strict aliasing warnings not raised in gcc9.
To Reproduce
Expected behavior
No warnings
Desktop (please complete the following information):
gcc10
The text was updated successfully, but these errors were encountered: