Want a way to strip comments from a C file

Clarence Dold cdold at starfish.Convergent.COM
Sat Mar 18 03:11:38 AEST 1989


>From article <4060 at ttidca.TTI.COM>, by hollombe at ttidca.TTI.COM (The Polymath):
> In article <880 at m10ux.UUCP> mnc at m10ux.UUCP (Michael Condict) writes:
> }I recently posted to this group a shell script that calls three sed scripts
> }to extract function prototypes from (practically) any C source.  One of the
> }three sed scripts consisted of little more than comment removal -- exactly
> }what you are looking for.  Here is the relevant portion:

I managed to miss the original question, but none of the replies I've seen
use the compiler to strip comments.
>From UNIX cpp target.c will strip off the comments.
>From Microsoft QuickC, QCL -E target.c will strip the comments.

Since both cases are a part of a normal compile, they have to be 
'double-escape/ comment in a comment'- proof.

-- 
Clarence A Dold - cdold at starfish.Convergent.COM         (408) 435-5293
                ...pyramid!ctnews!starfish!cdold         
                P.O.Box 6685, San Jose, CA 95150-6685



More information about the Comp.lang.c mailing list