Closed Sei-Lisa closed 5 years ago
This indeed would be an issue for preprocessor generated unique variable names. Thanks for the BR.
Ok, give this a try. It's actually subtly broken, but probably nobody will ever notice in real world use cases.
Thank you very much, this does solve my use case!
This code:
results in this output:
Note the line number to which
__LINE__
expands to is 2, not 7, because its evaluation works by retrieving the line number where the__LINE__
token itself appears, not where it's expanded. This deters about every real use case.The output with mcpp, gcc and wave is the expected. For example, with gcc: