Hi Rafael,
2013/5/31 Rafael Espíndola <[email protected]>:
> With this the user would get an undefined reference instead of a
> compiler error, no?
Well, yes/no. The __atomic_fetch_* functions can only be applied to
integer types. Poorly constructed example:
struct henk {
char x[100];
};
int
main() {
_Atomic(struct henk) piet;
struct henk jan;
__atomic_fetch_xor(&piet, jan, 5);
}
bla.c:10:2: error: first argument to bitwise atomic operation must be
a pointer to integer ('_Atomic(struct henk) *' invalid)
As we should in my opinion always support __atomic_fetch_* for all the
integer types available (and the number of integer types is rather
small), I'd rather not add explicit code to Clang to
whitelist/blacklist certain sizes.
Thoughts?
--
Ed Schouten <[email protected]>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits