comment style

Steven King sking at nowhere.uucp
Mon Jan 14 14:04:52 AEST 1991


In article <551 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
>NOTE:  Not all existing preprocessors treat // comments the same way.
>What I have stated above is as specified in the latest documentation
>for C++.  Some existing (older) C++ compilers behave differently.
>For C, // comments are an extension, not part of any standard, so who
>knows what different compilers will do?
>-- 

    Microsoft C, surprisingly enough, handles this correctly, while
 pcc's cpp ignores the // so that

 #define	RDR 1    // reader

   x = y[RDR] ;

 is expanded to

   x = y[1   // reader]

 resulting in a very frustrating source of error messages from cfront.
 This is a problem with most implementations of cfront that dont supply
 their own cpp and even with a few that do. 

 ( the LPI c compiler, which claims to be ANSI, ignores _//_, and barfs at 
 things like _#ident_ and most everything else )


-- 
                                        ..!cs.utexas.edu!ut-emx!nowhere!sking

been dazed and confused for so long its true; wanted an OS, never bargined for
you. Lotsa people hacking, few of them know, kernal of unix was created below...



More information about the Comp.std.c mailing list