Re: Strange C constructs
6 Mar 2004 13:44:11 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Strange C constructs (Jeremy Yallop) (2004-02-27)
Re: Strange C constructs (Alex Colvin) (2004-02-27)
Re: Strange C constructs (Derek M Jones) (2004-03-02)
Re: Strange C constructs (Dave Thompson) (2004-03-02)
Re: Strange C constructs (2004-03-02)
Re: Strange C constructs (Victor Zverovich) (2004-03-02)
Re: Strange C constructs (2004-03-06)
Re: Strange C constructs (2004-03-11)
| List of all articles for this month |

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.