Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!ames!oliveb!pyramid!ctnews!starfish!cdold From: cdold@starfish.Convergent.COM (Clarence Dold) Newsgroups: comp.lang.c Subject: Re: Want a way to strip comments from a C file Message-ID: <972@starfish.Convergent.COM> Date: 17 Mar 89 17:11:38 GMT References: <4060@ttidca.TTI.COM> Distribution: usa Organization: Convergent Technologies, San Jose, CA Lines: 19 From article <4060@ttidca.TTI.COM>, by hollombe@ttidca.TTI.COM (The Polymath): > In article <880@m10ux.UUCP> mnc@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@starfish.Convergent.COM (408) 435-5293 ...pyramid!ctnews!starfish!cdold P.O.Box 6685, San Jose, CA 95150-6685