Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCC preprocessor removing comments

Is it possible to instruct the GCC preprocessor not to remove comments when processing files?

like image 888
AOO Avatar asked Dec 30 '22 03:12

AOO


1 Answers

GCC has the -C option to preserve comments.

`-C'
     Do not discard comments.  All comments are passed through to the
     output file, except for comments in processed directives, which
     are deleted along with the directive.

     You should be prepared for side effects when using `-C'; it causes
     the preprocessor to treat comments as tokens in their own right.
     For example, comments appearing at the start of what would be a
     directive line have the effect of turning that line into an
     ordinary source line, since the first token on the line is no
     longer a `#'.
like image 154
TheGrandWazoo Avatar answered Jan 10 '23 02:01

TheGrandWazoo