Reputation: 6856
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?
Upvotes: 8
Views: 2540
Reputation: 46797
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...)
Upvotes: 2