Quantcast
Channel: Casting pointers to _Atomic pointers and _Atomic sizes - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by user3666171 for Casting pointers to _Atomic pointers and _Atomic sizes

This method is not legal C11, but I managed to fool my compiler (Intel 2019) into casting between atomic and non-atomic "simple" types as follows.Firstly I had a look inside stdatomic.h on my system...

View Article



Answer by Florian Weimer for Casting pointers to _Atomic pointers and _Atomic...

_Atomic changes alignment in some corner cases on Clang, and GCC will likely be fixed in the future as well (PR 65146). In these cases, adding _Atomic through a cast does not work (which is fine from a...

View Article

Casting pointers to _Atomic pointers and _Atomic sizes

By my reading of the standard,*(_Atomic TYPE*)&(TYPE){0} (in words, casting a pointer to a non-atomic to a pointer to a corresponding atomic and dereferencing) isn't supported.Do gcc and/or clang...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images