Fix #680: Add option to keep comments in preprocessed code by ludviggunne · Pull Request #681 · cppcheck-opensource/simplecpp · GitHub
Skip to content

Fix #680: Add option to keep comments in preprocessed code - #681

Merged
ludviggunne merged 3 commits into
cppcheck-opensource:masterfrom
ludviggunne:keep-comments
Jul 24, 2026
Merged

ludviggunne merged 3 commits into
cppcheck-opensource:masterfrom
ludviggunne:keep-comments

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the use case to treat comments differently in the source file and in included files. do you know the reason?

@danmar

danmar commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Comment thread test.cpp

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be questionable. do we want that comments are expanded. maybe the comment should only be kept on line 1.

but for now .. as far as I see it does not matter much. If somebody has strong opinions later and wants to change I am not against changing..

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc does copy comments in expansions. it will however turn c++-style comments in to c-style comments: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

@ludviggunne
ludviggunne merged commit 1537e9e into cppcheck-opensource:master Jul 24, 2026
25 checks passed
@ludviggunne
ludviggunne deleted the keep-comments branch July 24, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants