home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 9810 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.6 KB  |  49 lines

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