From: Mike Stump <mikestump@comcast.net>
To: Richard Guenther <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org, bkorb@gnu.org
Subject: Re: [PATCH] Fix bootstrap on OpenBSD, PR48851
Date: Mon, 04 Jul 2011 19:08:00 -0000 [thread overview]
Message-ID: <817CFF6E-A750-4060-95BD-3A3624AB4C8E@comcast.net> (raw)
In-Reply-To: <alpine.LNX.2.00.1107041301220.810@zhemvz.fhfr.qr>
On Jul 4, 2011, at 4:04 AM, Richard Guenther wrote:
> It happens that OpenBSD suffers from a bogus fixinclude that changes
> its perfectly valid NULL define from (void *)0 to 0. The fix itself
> appears to be very old and is completely bogus
I don't agree with the completely bogus part. Why not replace it with:
#undef NULL
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
#define NULL 0
#endif /* C++ */
#endif /* G++ */
?
This is C++ friendly, C friendly and modern. It should be very safe and should work just about everywhere.
> - it replaces
> (void *)0 with 0 under the assumption the former is invalid for C++ -
> which is true - but 0 is inappropriate for C which is much worse.
A #define to 0 is, for the C language, last I checked valid. You may not like it, but welcome to C.
> Thus, I propose to remove the fix altogether.
Breaking all systems that are broken, isn't a good tradeoff.
Now, looking at the PR, in this case, one could add a bypass __GNUG__ to this fix, and avoid the change on OpenBSD. This would also fix the problem. I do not think removing the fix is a good idea.
next prev parent reply other threads:[~2011-07-04 19:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 11:04 Richard Guenther
2011-07-04 12:46 ` Bruce Korb
2011-07-04 12:51 ` Richard Guenther
2011-07-04 14:35 ` David Edelsohn
2011-07-04 19:08 ` Mike Stump [this message]
2011-07-05 8:33 ` Richard Guenther
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=817CFF6E-A750-4060-95BD-3A3624AB4C8E@comcast.net \
--to=mikestump@comcast.net \
--cc=bkorb@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).