Confusing error for incorrect struct initialization

Mason mpeg.blue@free.fr
Sat Jun 18 17:42:00 GMT 2016


On 18/06/2016 18:42, lh mouse wrote:

> Initializing a `int *` with an `int` has to be permitted.
> It is making it an error that would be a bug.

The code I'm interested in is:

struct xxx { void *p; int a,b,c,d; double x,y; };
struct foo { struct xxx *p; int e,f,g; };
struct xxx s;
struct foo bar = { s }; /*** should be &s ***/

(I don't see any int pointers there.)

Do you see the error on the last line?
What error message would you expect a good compiler to output?

Regards.



More information about the Gcc-help mailing list