From: Mark Kettenis <kettenis@gnu.org>
To: eliz@gnu.org
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] Properly cast sentinels for concat()
Date: Tue, 05 Jul 2005 07:36:00 -0000 [thread overview]
Message-ID: <200507050735.j657ZvRk005224@jop31.nfra.nl> (raw)
In-Reply-To: <ud5pyp3tl.fsf@gnu.org> (message from Eli Zaretskii on Tue, 05 Jul 2005 01:08:22 +0200)
Date: Tue, 05 Jul 2005 01:08:22 +0200
From: Eli Zaretskii <eliz@gnu.org>
CC: gdb-patches@sourceware.org
Reply-to: Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 4 Jul 2005 15:36:05 +0200
> From: Mark Kettenis <kettenis@jive.nl>
>
> This fixes a few warnings with GCC 4.0 on OpenBSD. You'll probably
> won't see them on other systems, since they only show up if NULL is
> defined as an integer instead of a pointer constant (both are valid
> according to C standard). The stddef.h that comes with GCC defines
> NULL as (void *)NULL, but we don't use that one on OpenBSD.
>
> Anyway, I committed the attached patch as obvious.
Actually, it's not at all obvious,
Apparently not :(.
it's IMNSHO simply wrong. Casting
NULL to _anything_ should never be needed, unless NULL is abused
(i.e. used in a place where a pointer cannot be). Let's not decide
that a patch is ``obvious'' just because it happens to shut up the
compiler!
Unfortuntaly, as Daniel excellently explained, this isn't just to shut
up the compiler.
In this case, I'd say it's a bug in OpenBSD (it _should_ use stddef.h
that comes with GCC when a program is compiled with GCC), coupled with
the silly attitude of latest GCC versions to whine about more and more
perfectly valid C code constructs.
Let's not argue about these points. There are arguments for both
sides here. But the fact is that OpenBSD does provide it's own
stddef.h, so we have to deal with it.
Mark
prev parent reply other threads:[~2005-07-05 7:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-04 13:36 Mark Kettenis
2005-07-04 22:08 ` Eli Zaretskii
2005-07-04 23:16 ` Andreas Schwab
2005-07-05 1:32 ` Daniel Jacobowitz
2005-07-05 3:34 ` Eli Zaretskii
2005-07-05 4:23 ` Daniel Jacobowitz
2005-07-05 7:30 ` Mark Kettenis
2005-07-05 20:03 ` Eli Zaretskii
2005-07-05 7:36 ` Mark Kettenis [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=200507050735.j657ZvRk005224@jop31.nfra.nl \
--to=kettenis@gnu.org \
--cc=eliz@gnu.org \
--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