difference between gcc 3.2.2 and 3.3.1

lrtaylor@micron.com lrtaylor@micron.com
Mon Nov 24 20:10:00 GMT 2003


It looks to me that you are trying to implicitly include a "test" member in the tag_xwt_gtk_modal struct simply by including another struct (BASE) without declaring a variable of that type.  I'm not sure this is valid C/C++...  If I'm wrong, then you should probably file a bug report.  Otherwise, you (or the maintainers of this library) should probably fix the library.

typedef struct base
{
   int test;
} BASE, *P_BASE;

typedef struct tag_xwt_gtk_modal
{
  BASE; <<<------------------------- I don't believe this is valid.
  int modal;
  int canceled;
  struct {
     int c;
     int d;
  };
} MODAL, *P_MODAL;

int main()
{
   MODAL x;
   x.modal = 1;
   x.test = 1;
   x.c = 1;
}


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Tomaž Zupan
Sent: Monday, November 24, 2003 1:03 PM
To: gcc-help@gcc.gnu.org
Subject: RE: difference between gcc 3.2.2 and 3.3.1


> It would help if you included the actual error that your received.  Just
> copy the error text into the e-mail.
>

test.c:8: warning: declaration does not declare anything
test.c: In function `main':
test.c:21: error: structure has no member named `test'

-- 
Tomaž Zupan
ORPO d.o.o.




More information about the Gcc-help mailing list