facebook / facebook/zstd

Build error after #4328

Open
#4,348 4 comments 1 reaction 1 assignee Claimed by @terrelln View on GitHub
Dominant language
C
Stars
27.9k
Forks
2.6k
Avg merge
1d 3h
Merged PRs (30d)
8

Description

After https://github.com/facebook/zstd/pull/4328 landed, Chromium is experiencing a [build failure](https://ci.chromium.org/ui/p/chromium/builders/ci/win-arm64-rel/4260/overview) 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.