This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: relation between cccp and cppmain/cpplib


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]