From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul N. Hilfinger" To: gdb@sources.redhat.com Subject: Scope of typedefs Date: Mon, 01 Oct 2001 23:07:00 -0000 Message-id: <200110020607.XAA31160@localhost.localdomain> X-SW-Source: 2001-10/msg00016.html 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