From: Bob Rossi <bob_rossi@cox.net>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: vladimir@codesourcery.com, gdb@sources.redhat.com
Subject: Re: MI failures related to string printing
Date: Fri, 12 Jan 2007 12:30:00 -0000 [thread overview]
Message-ID: <20070112123008.GA5540@cox.net> (raw)
In-Reply-To: <200701121118.l0CBIh7p011299@brahms.sibelius.xs4all.nl>
On Fri, Jan 12, 2007 at 12:18:44PM +0100, Mark Kettenis wrote:
> I think the whole idea of doing string comparisons for C (or C++)
> "char *" pointers is flawed. There is no guarantee that a "char *"
> actually points to a null-terminated as the test shows. You should
> not treat "char *" any different from other pointers like "int *", at
> least not by default. You could implement a way for the user to
> specify that a "char *" is actually a pointer to a string instead of a
> single character. But otherwise I think the string comparison should
> only do for languages that have a genuine string type, such as Pascal.
GDB handles char*'s specially in the print command. There is an option
to tell it that the string shouldn't be displayed as null-terminated.
I think it's appropriate to handle the char* special as long as there is
an option not to do so.
Bob Rossi
prev parent reply other threads:[~2007-01-12 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-12 10:52 Vladimir Prus
2007-01-12 11:22 ` Mark Kettenis
2007-01-12 12:11 ` Nick Roberts
2007-01-12 12:30 ` Bob Rossi [this message]
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=20070112123008.GA5540@cox.net \
--to=bob_rossi@cox.net \
--cc=gdb@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
--cc=vladimir@codesourcery.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