warning: '/*' within comment

Sean Fagan seanf at sco.COM
Sat Jun 9 03:25:00 AEST 1990


In article <371 at necssd.NEC.COM> harrison at necssd.NEC.COM (Mark Harrison) writes:
>Are you sure about this?  I tried your example, and it both compiled and
>linted.  If this is true, then the following should also not work:

>#if MICROSOFT
>extern far char * x;  /* however it's done */
>#endif
>#if VMS
>extern char * x$something;  /* however it's done */
>#endif

This lexes just fine.  For most purposes, all we care about is the
preprocessor (or, if it's built into the compiler, the preprocessing stage).
Since you say you ran lint, I suspect you were on a traditional unix box,
and /lib/cpp was used.

/lib/cpp is notorious for being easy.  If neither MICROSOFT nor VMS is
defined, then the compiler will never see them, and, therefore, it can't
care.

If, however, you were to use a compiler with a built-in preprocessor, then
it might not work.  (uSoft C accepts it, I suspect because it considers $ a
valid lexable character [support for other languages, I suspect].)

Remember that no semantic analysis is being done.

-- 
-----------------+
Sean Eric Fagan  | "It's a pity the universe doesn't use [a] segmented 
seanf at sco.COM    |  architecture with a protected mode."
uunet!sco!seanf  |         -- Rich Cook, _Wizard's Bane_
(408) 458-1422   | Any opinions expressed are my own, not my employers'.



More information about the Comp.std.c mailing list