Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zig.h: Add some casts to __atomic macros to shut Clang warnings up.
This is a stupid Clang-ism: ❯ cat test.c int main() { int value = 42; int const *value_ptr = &value; int location; __atomic_store(&location, value_ptr, __ATOMIC_SEQ_CST); } ❯ gcc test.c -fsyntax-only ❯ clang test.c -fsyntax-only test.c:5:31: warning: passing 'const int *' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 5 | __atomic_store(&location, value_ptr, __ATOMIC_SEQ_CST); | ^~~~~~~~~ 1 warning generated. I have no idea why Clang doesn't define these builtins as taking const pointers for the parameters that are only read from. Anyway, after the next zig1.wasm update, this change should shut up these warnings that we've been seeing in CI during bootstrap for ages.
- Loading branch information