zig icon indicating copy to clipboard operation
zig copied to clipboard

Update wording for @cmpxchgStrong and @cmpxchgWeak in langref.html.in

Open toziegler opened this issue 1 year ago • 1 comments

The previous wording was incorrect as it indicated that @cmpxchgStrong and @cmpxchgWeak return null on "failure" even though it returns null on success and the current value of the atomic on "failure", closes #19979.

Further documentation might be helpful as described in #1516.

toziegler avatar Jun 24 '24 09:06 toziegler

@andrewrk Would you mind have a look at this?

The doc is very misleading.

jiacai2050 avatar Sep 01 '24 08:09 jiacai2050

I decided to take #21755 because it was a simpler and more obvious fix that immediately resolves the confusion. I think the docs for these builtins could do with a complete rewrite in the longer term though, not just this one sentence.

In any case, thanks for taking a stab at this!

alexrp avatar Jan 26 '25 22:01 alexrp