#endif <name> ???

Bob Devine devine at shodha.dec.com
Thu Oct 5 01:32:50 AEST 1989


In article <JFR.89Oct4133101 at tel3.tel3.tel.vtt.fi>, jfr at tel3.tel3.tel.vtt.fi (Jim Reilly) writes:
> The `#endif sparc`
> never caused any complaints on the sun's normal C compiler, but our
> 'Designer C++' compiler doesn't like it.  Is this just something
> funny with the c compilers on the SUN ?  At least I didn't find
> it in any C or ANSI C manuals around here.
> 
> #ifdef sparc
> .... other stuff deleted ....
> #endif sparc

  The ANSI C spec forbids the placing of anything except a comment
after the `#endif' (section 3.8.1).  Ditto for `#else'.

  The acceptance of a token after the cpp directives was never
consistently followed.  Some compilers took them, others didn't.
I've seen programs that had it both ways.

Bob Devine



More information about the Comp.lang.c mailing list