Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Scope of typedefs
@ 2001-10-01 23:07 Paul N. Hilfinger
  0 siblings, 0 replies; only message in thread
From: Paul N. Hilfinger @ 2001-10-01 23:07 UTC (permalink / raw)
  To: gdb

The code in dwarf2read and the other readers assigns all typedef symbols
to the static symbol list (file scope).  This is not, strictly speaking, 
correct, is it?  For example, in the (admittedly unusual) program

    static int Foo;

    int f (int y) {
      typedef int Foo;
      Foo x;
      x = 3;
      return x;
    }

    main () {
      f (Foo);   /* <<< */
    }

an attempt to print Foo in GDB when stopped at the commented line gives us
an

    Attempt to use a type name as an expression

message.  I understand that GCC would have to be modified to put typedefs
in proper scope, but is there any particular objection to having GDB be ready 
if it happens?  For that matter, does anyone know why things are as they are?

P. Hilfinger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-01 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-01 23:07 Scope of typedefs Paul N. Hilfinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox