Build error after #4328
After https://github.com/facebook/zstd/pull/4328 landed, Chromium is experiencing a build failure due to the changes in lib/decompress/zstd_decompress_block.c.
../../third_party/zstd/src/lib/decompress/zstd_decompress_block.c(1729,29): error: ISO C does not allow indirection on operand of type 'const void *' [-Werror,-Wvoid-ptr-dereference]
1729 | PREFETCH_L1(match); PREFETCH_L1(ZSTD_wrappedPtrAdd(match, CACHELINE_SIZE)); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/zstd/src/lib/decompress\../common/compiler.h(148,84): note: expanded from macro 'PREFETCH_L1'
148 | # define PREFETCH_L1(ptr) do { __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))); } while (0)
| ^~~~~~
1 error generated.
It seems like using ZSTD_wrappedPtrAdd returns a const void*, whereas previously it was a const BYTE*.
I'd prefer not to disable the -Wvoid-ptr-dereference warning for all of zstd if possible, can we either fix the type or disable the warning on this line after confirming that it is in fact safe?
cc @terrelln (from #4328)
Looks like we would need to add -Wvoid-ptr-dereference to our CI to avoid breaking that warning in the future.
How generic is this compilation flag ?
Is it gcc only ?