Path: utzoo!attcan!uunet!husc6!think!ames!oliveb!pyramid!markhall
From: markhall@pyramid.pyramid.com (Mark Hall)
Newsgroups: comp.std.c
Subject: Comments and pragma lines
Summary: Can you flag the error?
Message-ID: <48957@pyramid.pyramid.com>
Date: 29 Nov 88 00:31:18 GMT
Reply-To: markhall@pyramid.UUCP (Mark Hall)
Distribution: na
Organization: Pyramid Technology Corp., Mountain View, CA
Lines: 37

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

But if the two characters `/*' can occur legally in a
#pragma line, then I don't see how the compiler can flag the error.
For example, *if* the following is legal:

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

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
that, for the original source above, the compiler will give some other
complaint like:

error: .c: line 2, lhs of `*' operator must be l-value.
error: .c: line 2, undeclared id `Best'

or worse, it could give some really dreadful message way down in the
source listing that was actually due to the /* in the #pragma.  (you
know how hard it is to find those smoking open-comment/close-comment
mismatch errors).

So, the question is:  can /* occur legally on the #pragma line?

_______________________ 
*did I say `read'?  I meant, ``someone walked by my office with
 the standard in hand and I saw an open page''.