From owner-freebsd-current@FreeBSD.ORG Sat Nov 10 11:49:40 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59351FED; Sat, 10 Nov 2012 11:49:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0544F8FC08; Sat, 10 Nov 2012 11:49:39 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:5d9b:98de:ed36:153c] (unknown [IPv6:2001:7b8:3a7:0:5d9b:98de:ed36:153c]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 142E15C59; Sat, 10 Nov 2012 12:49:32 +0100 (CET) Message-ID: <509E3F53.4060609@FreeBSD.org> Date: Sat, 10 Nov 2012 12:49:39 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Greg 'groggy' Lehey Subject: Re: Traditional cpp References: <201211090658.qA96whII081757@pozo.com> <20121109072631.GQ77848@eureka.lemis.com> <509CFC88.7050606@FreeBSD.org> <20121110064621.GA10902@eureka.lemis.com> In-Reply-To: <20121110064621.GA10902@eureka.lemis.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Koop Mast , freebsd-current@freebsd.org, Niclas Zeising X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 11:49:40 -0000 On 2012-11-10 07:46, Greg 'groggy' Lehey wrote: > On Friday, 9 November 2012 at 13:52:24 +0100, Dimitry Andric wrote: ... >> Looks like yet another cpp -traditional abuse. > Use or abuse? Abuse, definitely. :-) A "C Preprocessor" is clearly meant to preprocess C, not arbitrary text files. You can see the problem of this approach, when you try to use another traditional preprocessor, like ports/devel/ucpp, for tools like Imake. Niclas Zeising can probably tell some interesting stories about this. Any subtly different spacing, token parsing behaviour, etc. tend to break those tools. They are basically relying on the specifics of the GNU cpp implementation. > In any case, it's not the only one. In the Good Old > Days people did things like that. So, it seems, does imake, and I'm > sure others will come out of the woodwork. > >> Clang will most likely never support traditional preprocessing. > > OK. > >> It is probably better to just use sed or awk for this kind of >> trickery. > > I'm not sure that's the way to go. It's more work than it's worth. > > What we really need is a traditional cpp. That's not difficult: > there's one in 4.3BSD (all 32 kB of source). OpenBSD also had one, > though it's gone now, so presumably that one has a clean license. > Both appear to be from pcc. Should we import it into the tree as, > say, tradcpp? Please check with Niclas and the other ports guys who have been wrestling with exactly this issue for some time. They may have lots of good suggestions.