C
Chris Hills
Jack Klein said:Visual C++ and any other compiler that supports that one is just plain
flat out wrong.
You know this, I know this but the person concerned when I told them
that the ISO standard did not do it the same way as VS told me that "you
would have thought the ISO C people would have got it right! They are
obviously out of touch!"
Apparently according to the "engineer" if MS do it that way then
Borland, Metrowerks, Keil, IAR and the ISO C people are wrong....
I remember a very well known compiler for the 8051 where this would
work:
#define SOME_MACRO some_value /* some comment */
...but this would not:
#define SOME_MACRO some_value // some comment
...when the macro was used like this:
int x = SOME_MACRO;
When the // version was used, the compiler would complain about a
missing semicolon when it started parsing the following statement.
Apparently they were not replacing comments with a single space
character (phase 3) until after expanding macros (phase 4) so they
expanded the assignment statement to:
int x = some_value // some comment ;
...then processed the comment which removed the semicolon.
That sounds reasonable.
// are dangerous as are many parts of C.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/