In article <u0fqs9->,
Russell Shaw <rjshawN_o@s_pam.netspace.net.au> wrote:
>Hi,
>In gcc-4.7 C99, i get an error (in a function scope):
>
> struct {
> int a;
> } sa;
>
> struct {
> int a;
> } sb;
>
> sb = sa;
>
>error: incompatible types when assigning to type 'struct <anonymous>' from type
>'struct <anonymous>'
You're asking rather a lot for the compiler to recognize that two different
structures just happen to have been defined the same way.
Try this:
struct foo {
int a;
};
struct foo sa;
struct foo sb;
sb = sa;
--
-Ed Falk,
http://thespamdiaries.blogspot.com/