From: Paul Koning <pkoning@equallogic.com>
To: drow@mvista.com
Cc: gdb@sources.redhat.com
Subject: Re: [rfc] xfailed tests in gdb.c++/classes.exp
Date: Fri, 28 Feb 2003 13:40:00 -0000 [thread overview]
Message-ID: <15967.26320.899802.396679@pkoning.dev.equallogic.com> (raw)
In-Reply-To: <20030228035911.GA16388@nevyn.them.org>
>>>>> "Daniel" == Daniel Jacobowitz <drow@mvista.com> writes:
Daniel> On Thu, Feb 27, 2003 at 09:51:06PM -0600, Michael Elizabeth
Daniel> Chastain wrote:
dc> 1) GDB prints "class X { public: ... }" when the programmer
dc> originally wrote "struct X { ... }".
>> I think this should be a PASS.
>>
dc> 2) GDB prints "class X { private: int x; ... }" when the
dc> programmer originally wrote "class X { int x; ... }".
>> I think this should be a PASS.
>>
>> David C formulated this idea as: if the text can be fed back into
>> a C++ compiler and generate the same results, then it's okay. By
>> and large I agree with that.
>>
>> If you look in gnats, you will see users complaining that they
>> can't print their string variables (because C++ strings are
>> implemented with layers of templates and derived classes). They
>> are complaining that operator overloading doesn't work. They are
>> complaining that they have a std::vector<Foo> and they can't even
>> look inside the damn thing.
>>
>> They aren't complaining that they wrote 'struct X { ... }' but gdb
>> prints 'class X { public: ... }'.
Daniel> Sure. But I suspect 2) represents an actual bug. Fixing
Daniel> this is about three lines in c-typeprint.c. Should we or
Daniel> shouldn't we?
Why? In both cases, the source code text and the GDB printout are
equivalent by the C++ rules. You can replace the one by the other
without any impact on the meaning of the program.
Certainly for those who are only half conversant with C++ type rules,
having "struct foo" replaced by "class foo { public:" may come as a
surprise, but that's a good incentive for them to learn the
language...
paul
next prev parent reply other threads:[~2003-02-28 13:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-28 3:51 Michael Elizabeth Chastain
2003-02-28 3:59 ` Daniel Jacobowitz
2003-02-28 13:40 ` Paul Koning [this message]
2003-02-28 20:58 ` Jason Molenda
-- strict thread matches above, loose matches on Subject: below --
2003-02-28 5:01 Michael Elizabeth Chastain
2003-02-28 15:15 ` Daniel Jacobowitz
2003-02-28 17:58 ` David Carlton
2003-01-03 23:27 Michael Elizabeth Chastain
2003-01-03 22:53 David Carlton
2003-02-28 1:30 ` Daniel Jacobowitz
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=15967.26320.899802.396679@pkoning.dev.equallogic.com \
--to=pkoning@equallogic.com \
--cc=drow@mvista.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