Can `cpp' strip off comments in C source code?

NightStrike nightstrike@gmail.com
Mon Dec 24 05:42:00 GMT 2007


On 12/23/07, PRC <panruochen@gmail.com> wrote:
> Hi,
>
> I want to use an AWK script to process a C source code. The comments may mislead the script. To make things easy, I'd like to strip off comments from the source code before having the script to process it. Since `cpp' is a c-preprecessor utility, I'd like to know weather it can be used to strip off comments from the source code. I check the manual, but have no idea which options to use. If it can't, is there any other tools which can do this?

AWK itself can do it, as can sed.



More information about the Gcc-help mailing list