Clang preprocessor for removing comments from C ++ files

I know that the gcc preprocessor can only use -fpreprocessed to remove comments from a file and leave everything else untouched, but how can I do the same with clang?

+4
source share
1 answer

As described here , use -E (and probably -P to exclude line number information)

clang -E -P <inputfile> -o <outputfile>

(although this will do more than just delete comments - it will also expand macros, etc.)

0
source

All Articles