Conversation
|
@osesov @firewave I don't feel I understand the removeComments. please share your thoughts. It says: why would somebody want to remove comment tokens in included files but keep them in source file? why is comment tokens added at all to the token list if removeComments is true. it is not clear to me that we want to have comments in the preprocessor output at all. It's not clear to me if all macro expansions will work fine if there are comments kept.. i.e.: |
|
Cppcheck needs to be able to fetch comments. But off the top of my head it fetches the comments from the "raw tokenlists". cppcheck does not expect comment tokens in the "preprocess" output if I am not mistaken. |
|
Natural behaviour of C preprocessor is to remove all comments. GCC's cpp allows -C flag to keep comments in the source code (also there is -CC flag, but this is out of scope). Current behaviour of simplecpp is that: If When Taking this as example: with 'DUI::removeComments = false` it will be expanded to (note that text comment has disappeared): This commit would result in following: |
you right these expansion do not work. No reason to apply this change then. |
Keep comments in the main text, not only in defines