home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp / 9261 < prev    next >
Encoding:
Text File  |  1992-08-13  |  966 b   |  41 lines

  1. Path: sparky!uunet!cs.utexas.edu!ut-emx!tivoli!TIVOLI.COM!stuart
  2. From: stuart@TIVOLI.COM (Stuart Jarriel)
  3. Newsgroups: comp.sys.hp
  4. Subject: /lib/cpp.ansi:macro replacement before or after concatanation
  5. Message-ID: <2649@tivoli.UUCP>
  6. Date: 13 Aug 92 19:53:46 GMT
  7. Sender: news@tivoli.UUCP
  8. Organization: Tivoli Systems, Inc
  9. Lines: 30
  10.  
  11. If you are using the HP ANSI cpp, should it be doing macro substitution
  12. before or after concatanation?
  13.  
  14. Example:
  15.  
  16. File slj.h
  17. ---------------------------------------
  18. #define silly           STUFF##here
  19. extern silly
  20. ---------------------------------------
  21.  
  22. $ /lib/cpp.ansi -DSTUFF=abc slj.h
  23. # 1 "slj.h"
  24. extern STUFFhere
  25.  
  26. $ /lib/cpp -DSTUFF=abc slj.h
  27. # 1 "slj.h"
  28. extern abc##here
  29.  
  30. $
  31.  
  32.  
  33. The way it is (concat before replacement) doesnt seem to
  34. be that useful. It can make the #defines useless.  The ANSI
  35. standard is not very clear on the order.
  36.  
  37. Any other comments?
  38. (is there a 'hacked' version from HP that has the reverse order?)
  39.  
  40. stuart
  41.