From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 10 09:30:12 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 328CA106566B for ; Thu, 10 Mar 2011 09:30:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E35CB8FC18 for ; Thu, 10 Mar 2011 09:30:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2A9UBcd026182 for ; Thu, 10 Mar 2011 09:30:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2A9UBZw026178; Thu, 10 Mar 2011 09:30:11 GMT (envelope-from gnats) Resent-Date: Thu, 10 Mar 2011 09:30:11 GMT Resent-Message-Id: <201103100930.p2A9UBZw026178@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steve Whiteley Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 873D5106566B for ; Thu, 10 Mar 2011 09:28:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 762A68FC17 for ; Thu, 10 Mar 2011 09:28:03 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2A9S3sT048203 for ; Thu, 10 Mar 2011 09:28:03 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p2A9S3o3048202; Thu, 10 Mar 2011 09:28:03 GMT (envelope-from nobody) Message-Id: <201103100928.p2A9S3o3048202@red.freebsd.org> Date: Thu, 10 Mar 2011 09:28:03 GMT From: Steve Whiteley To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/155429: Including malloc.h aborts compile. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2011 09:30:12 -0000 >Number: 155429 >Category: misc >Synopsis: Including malloc.h aborts compile. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 10 09:30:11 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Steve Whiteley >Release: 7.3-release >Organization: Whiteley Research Inc. >Environment: FreeBSD kipling 7.3-RELEASE-p3 FreeBSD 7.3-RELEASE-p3 #3: Sun Oct 3 17:29:39 PDT 2010 stevew@kipling:/usr2/obj/usr2/src/sys/KIPLING i386 >Description: The is not really a bug, just (IMHO) a dumb decision that affects at least up to 7.3. Including in a c++ source file aborts the compile, with a message informing to include stdlib instead. Well, fine, but some source files written for other OSes may include malloc.h, and are nonportable to FreeBSD simple because of this, i.e., if the malloc.h include is commented out the file compiles fine. The FreeBSD malloc.h should be an empty stub, or at worst emit an info message that malloc.h is not needed in FreeBSD. But to abort the compile? So I have the choice of hunting through a big source like OpenAccess to fix all the malloc.h includes, or hacking the include file itself (my approach, but it always reverts when I update). >How-To-Repeat: test.cc --------- #include int main() { return 0; } >Fix: /* $FreeBSD: src/include/malloc.h,v 1.5.38.1 2010/02/10 00:26:20 kensmith Exp $ */ #if __STDC__ /* XXX commented to avoid ridiculousness #error " has been replaced by " */ #else #include #endif >Release-Note: >Audit-Trail: >Unformatted: