From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: bkorb@gnu.org
Subject: [PATCH] Fix bootstrap on OpenBSD, PR48851
Date: Mon, 04 Jul 2011 11:04:00 -0000 [thread overview]
Message-ID: <alpine.LNX.2.00.1107041301220.810@zhemvz.fhfr.qr> (raw)
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 - 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.
Thus, I propose to remove the fix altogether. Platform maintainers
can arrange for a new fix if the platforms still need fixing (which
I seriously doubt after so many years and platform obsoletion).
This restores bootstrap on OpenBSD.
Ok for trunk and active branches?
Thanks,
Richard.
2011-07-04 Richard Guenther <rguenther@suse.de>
PR bootstrap/48851
* inclhack.def (void_null): Remove bogus fix.
* fixincl.x: Regenerated.
Index: fixincludes/inclhack.def
===================================================================
--- fixincludes/inclhack.def (revision 175800)
+++ fixincludes/inclhack.def (working copy)
@@ -4399,32 +4399,6 @@ fix = {
/*
- * AIX and Interix headers define NULL to be cast to a void pointer,
- * which is illegal in ANSI C++.
- */
-fix = {
- hackname = void_null;
- files = curses.h;
- files = dbm.h;
- files = locale.h;
- files = stdio.h;
- files = stdlib.h;
- files = string.h;
- files = time.h;
- files = unistd.h;
- files = sys/dir.h;
- files = sys/param.h;
- files = sys/types.h;
- /* avoid changing C++ friendly NULL */
- bypass = __cplusplus;
- select = "^#[ \t]*define[ \t]+NULL[ \t]+\\(\\(void[ \t]*\\*\\)0\\)";
- c_fix = format;
- c_fix_arg = "#define NULL 0";
- test_text = "# define\tNULL \t((void *)0) /* typed NULL */";
-};
-
-
-/*
* Make VxWorks header which is almost gcc ready fully gcc ready.
*/
fix = {
Index: fixincludes/fixincl.x
===================================================================
--- fixincludes/fixincl.x (revision 175800)
+++ fixincludes/fixincl.x (working copy)
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Sunday June 5, 2011 at 09:04:54 PM CDT
+ * It has been AutoGen-ed Monday July 4, 2011 at 12:59:38 PM CEST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jun 5 21:04:54 CDT 2011
+/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Jul 4 12:59:38 CEST 2011
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 211 fixup descriptions.
+ * This file contains 210 fixup descriptions.
*
* See README for more information.
*
@@ -8199,48 +8199,6 @@ static const char* apzVa_I960_MacroPatch
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Void_Null fix
- */
-tSCC zVoid_NullName[] =
- "void_null";
-
-/*
- * File name selection pattern
- */
-tSCC zVoid_NullList[] =
- "curses.h\0dbm.h\0locale.h\0stdio.h\0stdlib.h\0string.h\0time.h\0unistd.h\0sys/dir.h\0sys/param.h\0sys/types.h\0";
-/*
- * Machine/OS name selection pattern
- */
-#define apzVoid_NullMachs (const char**)NULL
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zVoid_NullSelect0[] =
- "^#[ \t]*define[ \t]+NULL[ \t]+\\(\\(void[ \t]*\\*\\)0\\)";
-
-/*
- * content bypass pattern - skip fix if pattern found
- */
-tSCC zVoid_NullBypass0[] =
- "__cplusplus";
-
-#define VOID_NULL_TEST_CT 2
-static tTestDesc aVoid_NullTests[] = {
- { TT_NEGREP, zVoid_NullBypass0, (regex_t*)NULL },
- { TT_EGREP, zVoid_NullSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Void_Null
- */
-static const char* apzVoid_NullPatch[] = {
- "format",
- "#define NULL 0",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of Vxworks_Gcc_Problem fix
*/
tSCC zVxworks_Gcc_ProblemName[] =
@@ -8591,9 +8549,9 @@ static const char* apzX11_SprintfPatch[]
*
* List of all fixes
*/
-#define REGEX_COUNT 250
+#define REGEX_COUNT 248
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 211
+#define FIX_COUNT 210
/*
* Enumerate the fixes
@@ -8801,7 +8759,6 @@ typedef enum {
ULTRIX_CONST_FIXIDX,
ULTRIX_CONST2_FIXIDX,
VA_I960_MACRO_FIXIDX,
- VOID_NULL_FIXIDX,
VXWORKS_GCC_PROBLEM_FIXIDX,
VXWORKS_NEEDS_VXTYPES_FIXIDX,
VXWORKS_NEEDS_VXWORKS_FIXIDX,
@@ -9823,11 +9780,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
VA_I960_MACRO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVa_I960_MacroTests, apzVa_I960_MacroPatch, 0 },
- { zVoid_NullName, zVoid_NullList,
- apzVoid_NullMachs,
- VOID_NULL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aVoid_NullTests, apzVoid_NullPatch, 0 },
-
{ zVxworks_Gcc_ProblemName, zVxworks_Gcc_ProblemList,
apzVxworks_Gcc_ProblemMachs,
VXWORKS_GCC_PROBLEM_TEST_CT, FD_MACH_ONLY,
next reply other threads:[~2011-07-04 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 11:04 Richard Guenther [this message]
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
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=alpine.LNX.2.00.1107041301220.810@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=bkorb@gnu.org \
--cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).