E
Edward Rutherford
I am porting a codebase that makes extensive use of the following
construction:
#define CAT(a,b) a##b
#define COMMENT CAT(/,/)
COMMENT This is a comment
It works as intended on the original Windows system, but not on the
target compiler, which claims that comments should not be processed after
macro expansion. So I have an odd situation where the preprocessor output
is as intended and is compilable, whereas the original file is not.
What is the truth, according to the standards? If it is invalid, can
anyone suggest an alternative definition for the COMMENT macro that will
achieve the same effect?
Thanks.
construction:
#define CAT(a,b) a##b
#define COMMENT CAT(/,/)
COMMENT This is a comment
It works as intended on the original Windows system, but not on the
target compiler, which claims that comments should not be processed after
macro expansion. So I have an odd situation where the preprocessor output
is as intended and is compilable, whereas the original file is not.
What is the truth, according to the standards? If it is invalid, can
anyone suggest an alternative definition for the COMMENT macro that will
achieve the same effect?
Thanks.