https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121209
--- Comment #5 from Halalaluyafail3 <luigighiron at gmail dot com> --- (In reply to uecker from comment #4) > I think both GCC /clang are correct, we have > > "If any of the original types satisfies all requirements of the composite > type, it is unspecified whether the composite type is one of these types or > a different type that satisfies the requirements." > > In principle, I think typedef show allow redeclarations of compatible types, > but the standard is more strict and requires same type. Is it not required that the composite type of two types has to be the same when obtaining it twice, or that the order is irrelevant? Here is an example of where it could be an issue when not using typedef: #include<stdio.h> enum A:int{a}; enum B:int{b}; int main(){ puts(_Generic(1?(enum A*)0:(int*)0,enum B*:"yes",default:"no")); puts(_Generic(1?(enum A*)0:(int*)0,enum B*:"yes",default:"no")); } Each call to puts prints yes if the composite type of enum A and int is int, and no otherwise. If the composite type can change, then can this print both yes and no, in either order? Also, GCC has a somewhat loose interpretation of what 'same' type is already: typedef int i; typedef signed i; typedef int f(),f()[[unsequenced]]; These declarations are accepted by GCC, though the types can be distinguished (to distinguish i -funsigned-bitfields is required).