From owner-freebsd-ports@FreeBSD.ORG Tue Aug 19 18:45:37 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 557F1106567C for ; Tue, 19 Aug 2008 18:45:37 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0FB8FC27 for ; Tue, 19 Aug 2008 18:45:36 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 5936873098; Tue, 19 Aug 2008 20:48:07 +0200 (CEST) Date: Tue, 19 Aug 2008 20:48:07 +0200 From: Luigi Rizzo To: Jeremy Messenger Message-ID: <20080819184807.GA25850@onelab2.iet.unipi.it> References: <20080819172631.GA25160@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: ports@freebsd.org 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 18:45:37 -0000 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... cheers luigi