Incomplete type message in gdb

Federico Mena Quintero
Wed Jun 3 18:21:00 GMT 1998


I asked Richard Henderson this same question, and he told me to
redirect it to you.

I am using egcs-2.90.27 980315 and GDB 4.16 -- these are the ones that
come with Red Hat Linux 5.1 for the Alpha.

I have some code like this:

  typedef struct _Foo Foo;

  struct _Foo {
          ... blah blah ...

That is, the typedef is before the struct declaration.  When I run gdb
on such a program and try to print a variable declared as

   Foo fum;

then gdb says <incomplete type>.  I can do a cast to struct _Foo and
print it fine.  If I put the typedef after the struct declaration, it
prints it fine.

Do you have any suggestions?



More information about the Gdb mailing list