Re: implementing #include etc without pre-preprocessing

sethml@ugcs.caltech.edu (Seth LaForge)
22 Mar 1997 23:32:10 -0500

          From comp.compilers

Related articles
implementing #include etc without pre-preprocessing sfrederi@asc.corp.mot.com (Sudhakar Frederick) (1997-03-16)
Re: implementing #include etc without pre-preprocessing thetick@scruz.net (Scott Stanchfield) (1997-03-18)
Re: implementing #include etc without pre-preprocessing bothner@cygnus.com (1997-03-21)
Re: implementing #include etc without pre-preprocessing ftit07bv85@pop.anti.wanadoo.spam.fr (1997-03-21)
Re: implementing #include etc without pre-preprocessing ok@cs.rmit.edu.au (1997-03-21)
Re: implementing #include etc without pre-preprocessing sethml@ugcs.caltech.edu (1997-03-22)
| List of all articles for this month |
From: sethml@ugcs.caltech.edu (Seth LaForge)
Newsgroups: comp.compilers
Date: 22 Mar 1997 23:32:10 -0500
Organization: California Institute of Technology, Pasadena
References: 97-03-090 97-03-107 97-03-131
Keywords: C, syntax

On 21 Mar 1997 10:27:00 -0500, Richard A. O'Keefe <ok@cs.rmit.edu.au> wrote:
>I further note that the approach of conditionally skipping things but
>still requiring those things to be well formed is used in SGML. (Not
>_by_ SGML itself, but people can set up conditional forms in SGML DTDs
>and then do conditional processing in a separate program.)


Actually, many people don't realize this, but C code which is skipped
by the preprocessor has to be tokenizable. Most C pre-processors
don't enforce this, but gcc's does. Specifically, if you have an
unterminated character or string constant which is skipped, the
pre-processor will complain. I discovered this when I tried to use
#if for block comments:


#if 0
This is supposed to be a block comment. It's not legal.
#endif


Seth
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.