[comp.unix.internals] cpp gone in 4.0

dcm@baldur.dell.com (Dave McCracken) (05/07/91)

urban@cbnewsl.att.com (john.urban) writes:

>In article <May.3.17.53.56.1991.10927@romulus.rutgers.edu> plona@romulus.rutgers.edu (Lawrence Plona) writes:
>>Although this has nothing to do with which is the better pre-processor,
>>the 3.2 man page for cpp says not to use it because cpp is part of cc
>>and is subject to change without notice. The cpp man page does not
>>appear in the 4.0 documentation.

>This is because cpp is completely gone for UNIX System V Release 4.0.  The
>C Pre Processor is now built into cc - no longer a separate command.  Run cc -P
>to run just the preprocessor part of cc.

This is true, but cpp is also shipped in /usr/ccs/lib/cpp because the
regular preprocessor changed the way it handles some constructs.  If
you have code that uses cpp on non-C files, you need to use this 
instead of cc -P or cc -E, since the other way will fail (see gdb
or emacs for an example of this).


--
Dave McCracken      dcm@dell.dell.com      (512) 343-3720
Dell Computer       9505 Arboretum Blvd    Austin, TX 78759-7299

dcm@baldur.dell.com (Dave McCracken) (05/10/91)

urban@cbnewsl.att.com (john.urban) writes:

>In article <14717@ulysses.att.com> ekrell@ulysses.att.com (Eduardo Krell) writes:
>Well I guess I was mistaken.  It isn't physically gone.  I guess it's still their
>for backwards compatibility or something - extra baggage.  However, it's not
>a supported way of using the pre-processor.  You should use cc -E or cc -P.
>If you type in: truss -o /tmp/CPP -f cc -E file.c
>and then examine /tmp/CPP, you'll see that cpp is never called.

The cpp functionality is folded into acomp in SVR4.  The reason /usr/ccs/lib/cpp
is still provided is that ANSI requires different tokenizing rules for the ANSI
preprocessor.  This change means that any application using cpp on non-C files
(see most of the GNU products) must NOT use cc -E, but must use /usr/ccs/lib/cpp
if it is to work.

--
Dave McCracken      dcm@dell.dell.com      (512) 343-3720
Dell Computer       9505 Arboretum Blvd    Austin, TX 78759-7299