relation between cccp and cppmain/cpplib

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Thu Oct 22 21:15:00 GMT 1998


> Why two preprocessors (cccp and cppmain/cpplib) exists in sources ?
> 
> What is difference between them and why two ones  needed ?

They use two different technologies: cccp is the traditional /lib/cpp,
i.e. the stand-alone prepocessor (read input, produce output).

cpplib is an alternative in-process preprocessor. Compared to cpp, it
provides the following advantages (in theory):
- communication overhead is reduced; cpp and cc1/cc1plus don't need to
  communicate via files/sockets anymore. Instead, the preprocessor
  output is parsed while it is produced.
- cc1 could actually access preprocessor symbol tables. This would
  allow to give correct column numbers in macro expansions, and
  enable single-stepping through macros.

So in the long run, cpplib could replace cccp. If it ever does, it
also has to provide a stand-alone executable for other cpp
applications (e.g. imake), this is what cppmain is for. Unfortunately,
cpplib is not complete, yet.

Hope this helps,
Martin

P.S. Do you also parse cccp in cyrillic letters (CCCP)? :-)
No offense intended.



More information about the Gcc mailing list