I know the gcc preprocessor can use -fpreprocessed to only remove comments from a file and leave the rest untouched but how can I do the same with clang?
As decribed here, use -E (and probably -P, to exclude line number info)
clang -E -P <inputfile> -o <outputfile>
(although this will do more than just remove comments - it'll also expand macros etc...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With