Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This noncompliant code example using atomic integers can result in unsigned integer overflow wrapping:

 

Code Block
atomic_int i;
int ui1;

/* Initialize i, ui1 */

atomic_fetch_add(&i, ui1);

Compliant Solution

...