Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Sep 2011 18:27:41 -0400 (EDT)
From:      Benjamin Kaduk <kaduk@MIT.EDU>
To:        Lev Serebryakov <lev@freebsd.org>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: WITHOUT_GCC flag disables installation of /usr/bin/cpp too -- is it Ok?
Message-ID:  <alpine.GSO.1.10.1109091818060.1411@multics.mit.edu>
In-Reply-To: <1997790603.20110907212004@serebryakov.spb.ru>
References:  <1231707981.20110907201053@serebryakov.spb.ru> <4E67A720.2000903@FreeBSD.org> <1997790603.20110907212004@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---559023410-274034473-1315607261=:1411
Content-Type: TEXT/PLAIN; charset=windows-1251; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Wed, 7 Sep 2011, Lev Serebryakov wrote:

> Hello, Dimitry.
> You wrote 7 =F1=E5=ED=F2=FF=E1=F0=FF 2011 =E3., 21:17:20:
>
> I think, that /usr/bin/cpp is valuable by itself, as it is handy
> generic preprocessor tool, useful for preparing complex ipfw scripts,
> for example. All others are bundled together, for sure.

I am not really convinced.  /usr/bin/cpp is the C preprocessor, and it is=
=20
only required to emit output that its bundled C compiler will accept as=20
input.  In particular, it can do whatever it wants with whitespace,=20
wrapping and unwrapping lines, outputting other spurious text, &c..
From=20cpp(1):
        The C preprocessor is intended to be used only with C, C++, and Obj=
ec-
        tive-C source code.  In the past, it has been abused as a general t=
ext
        processor.  It will choke on input which does not obey C's lexical
        rules.  For example, apostrophes will be interpreted as the beginni=
ng
        of character constants, and cause errors.  Also, you cannot rely on=
 it
        preserving characteristics of the input which are not significant t=
o
        C-family languages.  If a Makefile is preprocessed, all the hard ta=
bs
        will be removed, and the Makefile will not work.
The (incredibly brain-dead) build system at $work runs cpp on a Makefile,=
=20
which I had to hack around in order to get things to work.  It's really an=
=20
ugly hack, though, and is not at all robust.  I wish I didn't have to.

If you want a general-purpose macro processor, please consider using=20
something that was designed as a general-purpose macro processor (e.g.=20
m4(1) which is in base) -- abusing cpp(1) is just asking for weird/subtle=
=20
errors to be introduce in the future.

-Ben Kaduk

>
> I think, it is good idea to exclude cpp from this list (but not from
> WITHOUT_TOOLCHAIN, of course).
---559023410-274034473-1315607261=:1411--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.GSO.1.10.1109091818060.1411>