On Thu Nov 9 22:19:55 2023 +0000, Zebediah Figura wrote:
I'm curious, what's clang's problem with this?
The warning looks like this: ``` cpp.c:927:58: warning: incompatible pointer types initializing 'struct _rtti_object_hierarchy *' with an expression of type 'struct _rtti_object_hierarchy *' [-Wincompatible-pointer-types] ```
I didn't confront it with the spec, but it apparently handles structs declared like that differently from GCC. Here is another example that shows a similar difference:
``` void test(void) { static struct t1 { struct str { char c; } *s; } s1; static struct t2 { struct str { int i; } *s; } s2; s1.s = s2.s; } ```
Clang will warn on incompatible types in assignment. GCC will error on type redefinition followed by the same warning. It seems like clang puts `struct str` differently into the (sub-)namespaces (if that makes sense in C, it would in C++...).