https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65455

--- Comment #2 from Jens Gustedt <jens.gustedt at inria dot fr> ---
Since typeof is a gcc extension, there is not much arguing about it, but this
sounds wrong to me. Use cases I have, and that I seen used by others are for
example something like

_Atomic int a;
__typeof__(a) b __attribute__((weak,alias("a")));

This would systematically fail with that approach. When _Atomic will go into
wider use these difficulties will pop up more often.

Eliminating qualifiers in expressions is easy for arithmetic types at least,
something like

__typeof__((a)+0) b;

should always do the trick. In P99 I have implemented an equivalent to
stdatomic.h that seems to work well without assuming a drop of qualifiers.

(and BTW, the current version of stdatomic.h uses __auto_type, which makes it
incompatible with clang.)

Reply via email to