From owner-freebsd-ports@FreeBSD.ORG Tue Aug 19 19:00:09 2008 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98EAA106568F for ; Tue, 19 Aug 2008 19:00:09 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D5B688FC16; Tue, 19 Aug 2008 19:00:07 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48AB1836.8060104@FreeBSD.org> Date: Tue, 19 Aug 2008 20:00:06 +0100 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Luigi Rizzo References: <20080819172631.GA25160@onelab2.iet.unipi.it> <20080819184807.GA25850@onelab2.iet.unipi.it> In-Reply-To: <20080819184807.GA25850@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org, Jeremy Messenger Subject: Re: best way to work around vs ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2008 19:00:09 -0000 Luigi Rizzo wrote: > On Tue, Aug 19, 2008 at 01:12:37PM -0500, Jeremy Messenger wrote: >> On Tue, 19 Aug 2008 12:26:31 -0500, Luigi Rizzo wrote: >> >>> A fair amount of third party software in ports still uses >>> which in our system is like this: >>> >>> /* $FreeBSD: src/include/malloc.h,v 1.5 2001/11/07 23:14:31 obrien >>> Exp $ */ >>> #if __STDC__ >>> #error " has been replaced by " >>> #else >>> #include >>> #endif >>> >>> What is the best way to disable the error without an >>> explicit patch (there are over 200 patchfiles in ports >>> just doing that) ? >> I think patch it is best, because if I understand it corrects is that >> malloc() in stdlib.h is standard of ANSI C. Correct me if I am wrong. >> However, I don't see anything wrong with patch. You can simple use >> wildcard (*.c) or use find(1) to find files to replace the malloc.h -> >> stdlib.h by use REINPLACE_CMD without have to create multi-file patch. > > i am not questioning the correctness of using stdlib.h rather than malloc.h, > nor the fact that if the upstream is cooperating, one surely should pass patches > upstream. > > However this malloc.h (and missing sys/types.h -- there's another > 200+ patch files doing just that) seem to be very common porting > problem and so it would be issues and thought it could be nice to > find a fix that addresses those kind of problems. > > Wonder if a -I/usr/local/questionable-programs/include approach > could be used to wrap the handful of system headers that cause problems... It's a trivial fix. Just do it instead of over-engineering a solution :) Kris