Skip to content

Commit 8357878

Browse files
committed
docs
1 parent 1a68c18 commit 8357878

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

c/cert/src/rules/CON41-C/WrapFunctionsThatCanFailSpuriouslyInLoop.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This query implements the CERT-C rule CON41-C:
55
> Wrap functions that can fail spuriously in a loop
66
77

8-
98
## Description
109

1110
Functions that can fail spuriously should be wrapped in a loop. The `atomic_compare_exchange_weak()` and `atomic_compare_exchange_weak_explicit()` functions both attempt to set an atomic variable to a new value but only if it currently possesses a known old value. Unlike the related functions `atomic_compare_exchange_strong()` and `atomic_compare_exchange_strong_explicit()`, these functions are permitted to *fail spuriously*. This makes these functions faster on some platforms—for example, on architectures that implement compare-and-exchange using load-linked/store-conditional instructions, such as Alpha, ARM, MIPS, and PowerPC. The C Standard, 7.17.7.4, paragraph 4 \[[ISO/IEC 9899:2011](https://wiki.sei.cmu.edu/confluence/display/c/AA.+Bibliography#AA.Bibliography-ISO%2FIEC9899-2011)\], describes this behavior:

0 commit comments

Comments
 (0)