onload
onload copied to clipboard
Warning -Wdeprecated-volatile in C++20
This toy code (godbolt link):
typedef int ci_int32;
typedef struct { volatile ci_int32 n; } ci_atomic_t;
bool f(ci_atomic_t* a) {
return --a->n == 0;
}
Triggers a warning in c++20: "decrement of object of volatile-qualified type 'volatile ci_int32' (aka 'volatile int') is deprecated".
In onload
This happens at least in ci_atomic_quick_inc
, ci_atomic_quick_dec
, ci_atomic_quick_inc_and_test
and ci_atomic_quick_dec_and_test
.
Hopefully it can be resolved upstream and enable us to build cleanly.
FYI there's ongoing discussion about whether this deprecation may have been a bad idea, and it's looking like it might get undeprecated again. See P2327.
On the other hand, these functions in Onload seem to be vestigial.