Re: Strange C constructs

RLake@oxfam.org.pe
6 Mar 2004 13:44:11 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Strange C constructs jeremy@jdyallop.freeserve.co.uk (Jeremy Yallop) (2004-02-27)
Re: Strange C constructs alexc@std.com (Alex Colvin) (2004-02-27)
Re: Strange C constructs derek@NOSPAMknosof.co.uk (Derek M Jones) (2004-03-02)
Re: Strange C constructs david.thompson1@worldnet.att.net (Dave Thompson) (2004-03-02)
Re: Strange C constructs vbdis@aol.com (2004-03-02)
Re: Strange C constructs viz@pisem.net (Victor Zverovich) (2004-03-02)
Re: Strange C constructs RLake@oxfam.org.pe (2004-03-06)
Re: Strange C constructs nmm1@cus.cam.ac.uk (2004-03-11)
| List of all articles for this month |
From: RLake@oxfam.org.pe
Newsgroups: comp.compilers
Date: 6 Mar 2004 13:44:11 -0500
Organization: Compilers Central
References: 04-02-147 04-03-019
Keywords: C, standards
Posted-Date: 06 Mar 2004 13:44:11 EST

> The newest C99 standard introduces single line comments (//...), but
> it can be formed in such a way using macro substitution and glueing.
                ^not I think you meant to say


> It is shown in the following example stolen from the standard:


> #define glue(x,y) x##y
> glue(/,/) k(); // syntax error, not comment


> K&R and previous C standard doesn't have such type of comment.
> So this code (AFAIK it is located in WTypes.h) is completely illegal
> in C and intended for use with brain-damadged Microsoft compilers.


It is, however, possible to run a C preprocessor as an independent
program, and thereby use it for other languages. I don't believe the
standard either explicitly permits or prohibits this. :) In that case,
bizarre constructs like the above might conceivably be useful.



Post a followup to this message

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