home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!centerline!franl
- From: franl@centerline.com (Fran Litterio)
- Subject: Re: cpp looking where it shouldn't
- In-Reply-To: mickan@rossinc.com's message of Thu, 27 Aug 1992 06:33:47 GMT
- Message-ID: <FRANL.92Aug28132145@draco.centerline.com>
- Sender: news@centerline.com
- Nntp-Posting-Host: draco
- Organization: CenterLine Software, Inc.
- References: <1992Aug27.063347.9144@rossinc.com>
- Date: Fri, 28 Aug 1992 18:21:45 GMT
- Lines: 35
-
- mickan@rossinc.com (Michael J. Andrew) writes:
-
- > I'm new to HP and this group. I'm also sure this must have been asked
- > before, but no luck on a search of our archived articles.
- >
- > #if VMS
- > #module vmsname
- > #else
- > #define NOTVMS
- > #fi
- >
- > The HP c89 compiler barfs on the "unknown" #module statement.
- >
- > We're coming from a varied DEC environment, VMS and Ultrix. The MIPS
- > compilers don't get upset about this.
- >
- > I don't know what ANSI has to say, but it seems to me that any complaints
- > by the preprocessor in the "false" part of an #if or #ifdef is
- > very antisocial.
-
- It's worse than you think. ANSI not only says the translator must
- check directives in compiled-out blocks, but ANSI says it must
- tokenize the text in compiled-out blocks. So this should not compile
- using an ANSI C translation system:
-
- #if 0
- Not your father's compiler.
- #endif
-
- The appostrophe starts a character literal token which is never
- terminated.
- --
- franl@centerline.com || Fran Litterio
- uunet!centerline!franl || CenterLine Software R&D
- 617-498-3255 || 10 Fawcett St, Cambridge, MA, USA 02138-1110
-