diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-27 09:51:51 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-28 13:01:35 +0100 |
| commit | aa37a5a0c4e5a74aebc029c6513f762da2208658 (patch) | |
| tree | cf8da9dd0f7057b2c121857908e725aedec90a54 /lib/std/array_hash_map.zig | |
| parent | 183bb8b08403ab594cdc543c2db2503e7eac0052 (diff) | |
| download | zig-aa37a5a0c4e5a74aebc029c6513f762da2208658.tar.gz zig-aa37a5a0c4e5a74aebc029c6513f762da2208658.zip | |
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.
Diffstat (limited to 'lib/std/array_hash_map.zig')
0 files changed, 0 insertions, 0 deletions
