onload icon indicating copy to clipboard operation
onload copied to clipboard

Warning -Wdeprecated-volatile in C++20

Open OfekShilon opened this issue 2 years ago • 1 comments

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.

OfekShilon avatar Aug 14 '22 12:08 OfekShilon

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.

rhughes-xilinx avatar Aug 15 '22 09:08 rhughes-xilinx