J
Jacek Dziedzic
.... making things like
#endif // of the "#ifdef DEBUG" part
valid? Or not?
- J.
#endif // of the "#ifdef DEBUG" part
valid? Or not?
- J.
... making things like
#endif // of the "#ifdef DEBUG" part
valid? Or not?
Alf P. Steinbach said:Except for multi-line macro definitions the answer is yes.
The answer for multi-line macro definitions can possibly be that
the standard is somewhat less than clear about the effect.
How is it "less than clear"? See 2.1 Phases of translation.
'2' happens earlier than '3', and those happen earlier than '4'.
So, a backslash+newline in a // comment makes the comment span
more than one line. Then the comment is replaced with a single
space character, and only after that the preprocessing directives
are executed.
So, by the time preprocessor gets its hands on the directives,
there are no more comments in the file.
You can probably find more information about the issue (which
I've nearly forgot, just a vague recollection that there is an
issue) by using a search engine, or delving into the standard.
I didn't know there was an issue...
Victor
Alf P. Steinbach said:How is it "less than clear"? See 2.1 Phases of translation.
'2' happens earlier than '3', and those happen earlier than '4'.
So, a backslash+newline in a // comment makes the comment span
more than one line. Then the comment is replaced with a single
space character, and only after that the preprocessing directives
are executed.
So, by the time preprocessor gets its hands on the directives,
there are no more comments in the file.
I didn't know there was an issue...
Neither did I until it was discussed either here or in
comp.lang.c++.moderated, I'm not sure. Seeing your comments I
think the issue was about __LINE__. But not sure...
Cheers,
- Alf
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.