Date: Fri, 9 Sep 2011 20:44:57 -0400 (EDT) From: "Sean C. Farley" <scf@FreeBSD.org> To: "Lev A. 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.BSF.2.02.1109092041520.3074@thor.farley.org> In-Reply-To: <alpine.GSO.1.10.1109091818060.1411@multics.mit.edu> References: <1231707981.20110907201053@serebryakov.spb.ru> <4E67A720.2000903@FreeBSD.org> <1997790603.20110907212004@serebryakov.spb.ru> <alpine.GSO.1.10.1109091818060.1411@multics.mit.edu>
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. --56599777-266539953-1315615497=:3074 Content-Type: TEXT/PLAIN; charset=windows-1251; format=flowed Content-Transfer-Encoding: 8BIT On Fri, 9 Sep 2011, Benjamin Kaduk wrote: > On Wed, 7 Sep 2011, Lev Serebryakov wrote: > >> Hello, Dimitry. >> You wrote 7 сентября 2011 г., 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 > only required to emit output that its bundled C compiler will accept as > input. In particular, it can do whatever it wants with whitespace, wrapping > and unwrapping lines, outputting other spurious text, &c.. > From cpp(1): > The C preprocessor is intended to be used only with C, C++, and Objec- > tive-C source code. In the past, it has been abused as a general text > processor. It will choke on input which does not obey C's lexical > rules. For example, apostrophes will be interpreted as the beginning > of character constants, and cause errors. Also, you cannot rely on it > preserving characteristics of the input which are not significant to > C-family languages. If a Makefile is preprocessed, all the hard tabs > will be removed, and the Makefile will not work. > The (incredibly brain-dead) build system at $work runs cpp on a Makefile, > which I had to hack around in order to get things to work. It's really an > 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 > something that was designed as a general-purpose macro processor (e.g. m4(1) > which is in base) -- abusing cpp(1) is just asking for weird/subtle errors to > be introduce in the future. Another option may be to install devel/ucpp. I have not used it before, but it may be good enough for preparing ipfw scripts. Sean -- scf@FreeBSD.org --56599777-266539953-1315615497=:3074--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.02.1109092041520.3074>