This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Casting NULL pointer
- From: Doug Evans <xdje42 at gmail dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 30 Aug 2015 09:06:37 -0700
- Subject: Re: [RFC] Casting NULL pointer
- Authentication-results: sourceware.org; auth=none
- References: <20150830100944 dot GA3916 at embecosm dot com>
On Sun, Aug 30, 2015 at 3:09 AM, Andrew Burgess
<andrew.burgess@embecosm.com> wrote:
> There are a small (~26) number of places where the NULL pointer is
> cast list this:
>
> char *wname = (char *) NULL;
>
> This compares to a huge number of places (~726) where we don't use a
> cast, so:
>
> const char *name = NULL;
>
> I've never thought that the cast was either necessary or a
> particularly good idea, it feels like unneeded clutter.
>
> I only ask because I was about to push an obvious change that made a
> minor edit to a line containing one of the above casts. I was tempted
> to remove the cast, in this case, as a clean up; however, I'm looking
> for confirmation that such a change would be viewed as clean up, and
> not an unnecessary change.
>
> As a follow on, given the small number, I'm happy to submit a
> patch(es) to remove all of these casts, if its felt that would be a
> reasonable clean up.
Hi.
SGTM