Subject: Re: '//' for comments in C code? (archivers/unace)
To: Ben Collver <collver1@comcast.net>
From: Christos Zoulas <christos@zoulas.com>
List: tech-pkg
Date: 01/21/2004 18:05:48
On Jan 21, 2:12pm, collver1@comcast.net (Ben Collver) wrote:
-- Subject: Re: '//' for comments in C code? (archivers/unace)
| On Wed, Jan 21, 2004 at 09:48:15PM +0000, Christos Zoulas wrote:
| > Sed seems simpler:
| >
| >
| > .c.o:
| > @(echo ${CC} ${CFLAGS} -c $< && \
| > PID=$$$$ && \
| > sed -e 's,//.*$$,,' < $< > tmp$${PID}.c && \
| > ${CC} ${CFLAGS} -c tmp$${PID}.c && \
| > mv tmp$${PID}.o $@ && \
| > rm -f tmp$${PID}.c)
| >
| > I would have used /dev/stdin, but some cc's check that the file ends in .c
|
| Would this cause the lynx compile to fail?
|
| >From /usr/pkgsrc/www/lynx/work/lynx-2-8-4/src/LYMain.c:
|
| printf(gettext(
| "See http://lynx.browser.org/ and the online help for more information.\n\n"
| ));
|
| If I understand it right, sed would change this to
|
| printf(gettext(
| "See http:
| ));
Yup, you need some smarted pre-processing so that it understands quoting.
christos