Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!nrl-cmf!ames!elroy!spl1!laidbak!katzung
From: katzung@laidbak.UUCP (Brian Katzung)
Newsgroups: comp.std.c
Subject: Re: Comments and pragma lines
Summary: Read the phases-of-analysis list
Message-ID: <1827@laidbak.UUCP>
Date: 29 Nov 88 17:31:36 GMT
References: <48957@pyramid.pyramid.com>
Reply-To: katzung@laidbak.UUCP (Brian Katzung)
Distribution: na
Organization: Lachman Associates, Inc., Naperville, Illinois
Lines: 35

In article <48957@pyramid.pyramid.com> markhall@pyramid.UUCP (Mark Hall) writes:
>Consider the following source:
>
>#pragma rotate lid counterclockwise    /* store pointers in
>					* Best Foods 
>					* Mayonaise Jars.
>					*/
>
>Is it legal to start the comment on the pragma line?  From what I read*
>in the standard, it is illegal.  Fine.  For such cases, I'd like to see the 
>message:
>
>error: .c: line 1, cannot open comment on #pragma line

Which part of the standard were you "reading"?

The comment should have been reduced to a single space by the time the
#pragma directive is interpreted.  At that time, you might get a com-
plaint about "extra tokens" or some other syntax error, but only if the
preprocessor doesn't like trailing white space.

>#pragma ascii sunbakedchar &^%$/*()!

If that is supposed to be a character list, the preprocessor/compiler
writer can probably make it a lot easier on herself by using a string
literal.

>then of course the compiler can't know in general that ``/*'' in the
>pragma line is the ``open comment'' token.  The consequence of this is

Comments (really white space) are no longer significant by the time the
compilation phase occurs--white space preprocessor tokens would normally
just be discarded when the compiler token stream is created.

 -- Brian Katzung  ...!{sun,spl1}!laidbak!katzung