In section "5.47 Built-in functions for atomic memory access", both "nand" examples show incorrect code in their second lines.
Incorrect: { tmp = *ptr; *ptr op= value; return tmp; } { tmp = *ptr; *ptr = ~tmp & value; return tmp; } // nand Correct (move the "~" in 2nd line): { tmp = *ptr; *ptr op= value; return tmp; } { tmp = *ptr; *ptr = tmp & ~value; return tmp; } // nand Incorrect: { *ptr op= value; return *ptr; } { *ptr = ~*ptr & value; return *ptr; } // nand Correct (move the "~" in 2nd line): { *ptr op= value; return *ptr; } { *ptr = *ptr & ~value; return *ptr; } // nand p.s. I looked all over the place for the proper way to report a documentation error, and was unable to find anything helpful. Perhaps the manual itself ought to point out where to report such.