On 6/20/06, Russell Bateman <[EMAIL PROTECTED]> wrote:
it seemed to me that it was in the C++ part of the document.
c99 standard does not have any "C++ part"
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
Both c99 and c89 are ANSI C standards, but they are different. Are you confusing "ANSI C" with "c89 ANSI C" ? If so, then "c89 ANSI standard" indeed does not have //. "c99 ANSI C standard" does have //. Additional references: (2) 'gcc -std=c99 -pedantic' accepts //-comments just fine. (3) This page refers to '//' as "c99 feature implemented in gcc': http://gcc.gnu.org/gcc-3.4/c99status.html Yakov
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 >> > >> > >> >> > >