This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]