On 18/06/2016 09:49, lh mouse wrote: > Mason wrote: > >> I opened bug 71552: >> >> "Confusing error for incorrect struct initialization" >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71552 >> >> I don't understand Martin's reply in comment #1. >> >> Could someone explain? > > Those are GCC implementation details. > > In spite that in most cases implicit conversion from an integer > (except a null pointer constant, of course) to a pointer should be > considered a casual error, it is however required by the C standard: > > Making it an error would make GCC not conform to the standard just > because C is so broken. /me scratches head... Making what an error? The bug is a request to improve an existing error message. struct xxx { void *p; int a,b,c,d; double x,y; }; struct foo { struct xxx *p; int e,f,g; }; static struct xxx s = { 0 }; struct foo bar = { s }; /*** should be &s ***/ $ gcc-6 -c qoi.c qoi.c:4:20: error: initializer element is not constant struct foo bar = { s }; /*** should be &s ***/ ^ qoi.c:4:20: note: (near initialization for 'bar.p') Do you disagree that this is a confusing error message? Isn't this one better: incompatible types when initializing type 'struct xxx *' using type 'struct xxx' Regards.