From patchwork Mon Jul 4 11:04:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 103088 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6D65FB6F68 for ; Mon, 4 Jul 2011 21:04:45 +1000 (EST) Received: (qmail 22114 invoked by alias); 4 Jul 2011 11:04:43 -0000 Received: (qmail 22092 invoked by uid 22791); 4 Jul 2011 11:04:41 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 11:04:26 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 08B97867E2; Mon, 4 Jul 2011 13:04:25 +0200 (CEST) Date: Mon, 4 Jul 2011 13:04:24 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: bkorb@gnu.org Subject: [PATCH] Fix bootstrap on OpenBSD, PR48851 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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,