Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Paul N. Hilfinger" <hilfingr@otisco.mckusick.com>
To: gdb@sources.redhat.com
Subject: Scope of typedefs
Date: Mon, 01 Oct 2001 23:07:00 -0000	[thread overview]
Message-ID: <200110020607.XAA31160@localhost.localdomain> (raw)

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


                 reply	other threads:[~2001-10-01 23:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200110020607.XAA31160@localhost.localdomain \
    --to=hilfingr@otisco.mckusick.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox