[LCP]stdio.h reference

ianezz at sodalia.it ianezz at sodalia.it
Tue Jan 8 20:05:01 UTC 2002


Pare che Santosh.Kawade at eyield.com, in un momento di ispirazione, abbia scritto:

 > >The preprocessor includes the files, expand the macros, 
 > > strips comments, and then send the output to the compiler. 
 > 
 > Does the preprocessor strips the comment or is it the Lexical Analyzer ( first
 > phase of compilation) which does that ?

With gcc it is surely the preprocessor (cpp).

You can try it by yourself with ``cpp source_with_comments.c''

AFAIK, GNU cpp guesses the language from the file extension (i.e. C
for .c, C++ for .cxx, .cpp, .C, etc.).
 
 > my second question is that you said the compiler compiles the code
 > and passes it to assembler. Does the assembler really comes into
 > picture or the compiler handles everything and passes the obj code
 > to linker to link into exe or library.

It should really come into picture. At least this is what can be
deduced from the gcc documentation.

But there is a simple experiment to do: rename `as' (and `gas') to
something else (i.e. `as.orig' and `gas.orig'), and see if the
compiler is still able to produce object files. It shouldn't.

-- 
UNIX diapers by Pannolini USPTO 2039887  http://www.uspto.gov
Matteo Ianeselli      ianezz AT sodalia.it  (+39) 0461 316452
Visita il LinuxTrent:            http://www.linuxtrent.it



More information about the linuxCprogramming mailing list