You know, I worked with this formally for years, but it's not impossible that I missed something.

The last time I looked at the spec (and I no longer have access to one because I've changed jobs and companies and the thing costs about $250), it seemed to me that it was in the C++ part of the document. I am certain of the "strict ANSI compliance" thing because I demonstrated it to myself once when it was important to be strictly ANSI compliant in something I was doing (unless things have changed with recent compiler versions). Here, where I work now, we're strictly ANSI compliant and that includes no C++ style comments, but truly, I haven't tested that assertion since I'd get crucified if I did. Maybe I'll try it before checking something in.

Russ

Yakov Lerner wrote:
On 6/20/06, Russell Bateman <[EMAIL PROTECTED]> wrote:
Formally speaking, C99 (ISO/IEC 9899:1999) still refers to "ANSI C"
which does not tolerate the C++ style comment operator.

In the draft standard c99 (*1), 6.4.9.2, page 66, // is
defined as a comment.

Is this something that was changed/removed
from the final standard ?

Yakov

(*1) http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf

Yakov Lerner wrote:
> Some C sources that I have are c99, other are c89.
>
> The c99 sources can use //-style comments.
> The c89 sources can use only /**/-style comments.
>
> I'd like to have my "commentify" macro to
> use // in c99 sources, and /**/ in c89 sources.
>
> But how to tell those two types apart ? Any ideas ?
> I'm thinking about searching the file for pre-existing //.
> That's crude but I can't think of anything else.
> What would be good method to detect c99 vs c89 ?
>
> Yakov
>
>





Reply via email to