The C17 standard specifies a list of atomic operations. For example, an atomic read-write-modify operation on an atomic object of type A is defined in the standard as:
C atomic_fetch_add(volatile A *object, M operand);
But we can call atomic_fetch_add on non-atomic types:
static int x;
static int foo(void *arg) {
atomic_fetch_add(&x, 3);
}
My question: is the above atomic_fetch_add operation on the non-atomic object x guaranteed to be atomic?