From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
Cc: 'Michael Snyder' <msnyder@vmware.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] p-typeprint.c, move pointer use to after null-check.
Date: Tue, 08 Mar 2011 15:30:00 -0000 [thread overview]
Message-ID: <20110308145617.GO30306@adacore.com> (raw)
In-Reply-To: <004e01cbdd9d$5d383600$17a8a200$@muller@ics-cnrs.unistra.fr>
> No, I think that the code relies on the fact that physname
> is never null, but that the constructor or destructor could have no
> parameters, in which case physname would point to \0
> after the '+= 6'.
OK, we agree, in fact:
> Is this correct:
> if (physname && (*physname != 0))
> or is:
> if (physname && *physname != 0)
>
> better?
> or should I use:
> if (physname && *physname != '\0')
My suggestion was to remove the "physname [!= NULL]" part only.
Hence:
if (*physname != '\0')
(I think we have more cases of '\0' than 0 when we're checking
character values)
--
Joel
prev parent reply other threads:[~2011-03-08 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 20:37 Michael Snyder
2011-03-07 20:19 ` Michael Snyder
2011-03-08 6:54 ` Joel Brobecker
2011-03-08 14:56 ` Pierre Muller
2011-03-08 15:30 ` Joel Brobecker [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=20110308145617.GO30306@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=pierre.muller@ics-cnrs.unistra.fr \
/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