From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@gnat.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA/dwarf-2] Fix for the null record problem
Date: Thu, 26 Feb 2004 03:27:00 -0000 [thread overview]
Message-ID: <20040226032743.GA30615@nevyn.them.org> (raw)
In-Reply-To: <20040226023108.GF3425@gnat.com>
On Wed, Feb 25, 2004 at 06:31:08PM -0800, Joel Brobecker wrote:
> > > This is a followup on the thread that started with:
> > >
> > > http://sources.redhat.com/ml/gdb-patches/2004-02/msg00058.html
> > >
> > > The test proposed under that thread was dropped because an empty
> > > struct is not legal C. However, it is legal in Ada, and I've seen
> > > a message saying that it is also legal in C++.
> >
> > Seriously, I'd like to see a testcase that FAIL->PASS with this patch.
> > Can somebody get a C++ testcase, at least?
> >
> > the patch looks sensible, but I would like to see the testcase go in
> > at the same time, or we'll forget.
>
> I tried to update one of the C++ testcase to include an empty struct,
> but my C++ is completely rusty.
>
> In class2.cc, I tried adding
>
> struct empty_struct {};
>
> Is that a struct type definition or a class definition. In any case,
> GDB has no trouble at all printing the description of this type:
>
> (gdb) ptype empty_struct
> type = class empty_struct {
> }
>
> Does anybody know of a way to produce the "<incomplete type>" bug
> with C++? Otherwise, there is my upcoming null_record.exp test,
> but I need a bit more time before the first Ada testcase can be
> committed.
It occurs to me that C++ probably will not show the problem. The empty
struct is legal, but has size 1; the language requires:
struct empty_struct { } array[10];
assert (&array[0] != &array[1]);
This is one of the many quirks of the GNU C extension in question.
I'd like to have the empty struct test anyway. Remember to add a
variable of that type if you add a type to class2.cc; or newer GCCs
will just elide the type.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-02-26 3:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-19 14:01 Joel Brobecker
2004-02-19 21:52 ` Elena Zannoni
2004-02-19 23:29 ` Andrew Cagney
2004-02-19 23:37 ` Joel Brobecker
2004-02-26 2:31 ` Joel Brobecker
2004-02-26 3:27 ` Daniel Jacobowitz [this message]
2004-02-26 19:00 ` Joel Brobecker
2004-04-01 1:18 ` Joel Brobecker
2004-04-13 5:26 ` Joel Brobecker
2004-04-14 17:24 ` Jim Blandy
2004-04-14 17:47 ` Daniel Jacobowitz
2004-04-15 5:01 ` Jim Blandy
2004-04-15 20:43 ` Joel Brobecker
2004-04-16 3:18 ` Joel Brobecker
2004-04-16 3:59 ` Jim Blandy
2004-04-15 5:33 ` Jim Blandy
2004-02-26 19:49 Michael Elizabeth Chastain
2004-02-26 20:23 ` Joel Brobecker
2004-02-26 21:34 Michael Elizabeth Chastain
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=20040226032743.GA30615@nevyn.them.org \
--to=drow@false.org \
--cc=brobecker@gnat.com \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@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