Newsgroups: comp.std.c
Path: utzoo!sq!msb
From: msb@sq.sq.com (Mark Brader)
Subject: Re: warning: '/*' within comment
Message-ID: <1990Jun8.014100.8891@sq.sq.com>
Organization: SoftQuad Inc., Toronto Canada
References: <1990Jun1.200433.6919@druid.uucp> <13040@smoke.BRL.MIL> <16775@haddock.ima.isc.com>
Date: Fri, 8 Jun 90 01:41:00 GMT
Lines: 34

> /*
> Sample usage:
> 	mkscript src/*.c src/*.h src/makefile man/* readme > dist.txt
> */

Assuming that your source is in ASCII, the *appearance* of a /* inside
a comment may be obtained by using the sequence /, space, backspace, *.
Of course, some programs for displaying the file may elect to show ^H
for the backspace, so this won't always work.  There is no ANSI C problem
with this approach, at any rate, as anything is legal inside a comment.

The appearance of a */ can be obtained inside a comment similarly, but
I would term this usage so bizarre as to be misleading.

I would write the above comment as:

/*
 * Sample usage:
 * 	mkscript src/_*.c src/_*.h src/makefile man/_* readme > dist.txt
 *
 * (Ignore the _ characters; they are there to prevent "unclosed comment?"
 * warnings when this code is compiled!)
 */

And similarly using *_/file.c if */file.c was the usage.


-- 
Mark Brader	"Many's the time when I've thanked the DAG of past years
utzoo!sq!msb	for anticipating future maintenance questions and providing
msb@sq.com	helpful information in the original sources."	-- Doug A. Gwyn

This article is in the public domain.
