From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: andrew.burgess@embecosm.com
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Casting NULL pointer
Date: Sun, 30 Aug 2015 12:33:00 -0000 [thread overview]
Message-ID: <201508301233.t7UCX0Nv012040@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20150830100944.GA3916@embecosm.com> (message from Andrew Burgess on Sun, 30 Aug 2015 11:09:45 +0100)
> Date: Sun, 30 Aug 2015 11:09:45 +0100
> From: Andrew Burgess <andrew.burgess@embecosm.com>
>
> 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.
The cast isn't necessary in assignments like that. However it is
still necessary to cast NULL to an appropriate pointer when passing it
as an argument to a varargs function.
next prev parent reply other threads:[~2015-08-30 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-30 10:09 Andrew Burgess
2015-08-30 12:33 ` Mark Kettenis [this message]
2015-08-30 13:46 ` Andrew Burgess
2015-08-30 16:06 ` Doug Evans
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=201508301233.t7UCX0Nv012040@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/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