Re: Traditional cpp

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 10 Nov 2012 12:49:39 +0100
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.
Received on Sat Nov 10 2012 - 10:49:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:32 UTC