egcs-1.1b BUG ? typeof() not working inside union or struct without tag

Martin Cornelius Elke.Hadtstein@t-online.de
Sun Oct 25 15:03:00 GMT 1998


well i hope this isn't an FAQ, i skimmed through the lists and didn't
find anything on this topic.

Trying to compile KDE-1.0 with a self built egcs-1.1b on a Linux system
with libc.so.5.4.46 (SusE5.3) failed when sys/wait.h was included.
Tracking down the error a little bit, i found that obvoiusly typeof()
doesn't work inside a struct or union declaration that doesn't have a
tag.

e.g., the following does not compile:

int main(int argc, char *argv[])
{
  int y;
  union  {
    typeof (y) a;
    int b;
  } a;
}

however, if you give the union a tag, it compiles !  try:

int main(int argc, char *argv[])
{
  int y;
  union u {
        /*  ^^^ */
    typeof (y) a;
    int b;
  } a;
}

the same problem shows up with struct declarations.

both examples compile with gcc-2.7.2.1, so i doubt this is a bug in
egcs.

If anybody can help me , PLEASE reply by email also, because i'm not
subscribed to the list... thanks

Martin





More information about the Gcc-bugs mailing list