home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / sgi / 13536 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.9 KB  |  58 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!sgigate!odin!bananapc.csd.sgi.com!ciemo
  2. From: ciemo@bananapc.csd.sgi.com (Dave Ciemiewicz)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Bug in /usr/lib/cpp ?
  5. Message-ID: <1992Sep11.183618.25338@odin.corp.sgi.com>
  6. Date: 11 Sep 92 18:36:18 GMT
  7. References: <stefans.716210195@bauv106>
  8. Sender: news@odin.corp.sgi.com (Net News)
  9. Organization: Silicon Graphics, Customer Support Division
  10. Lines: 45
  11. Nntp-Posting-Host: bananapc.csd.sgi.com
  12.  
  13. In article <stefans.716210195@bauv106>, stefans@bauv106.bauv.unibw-muenchen.de (Stefan Schwarz) writes:
  14. |> Hi,
  15. |> 
  16. |> the following statements cause trouble with cpp on Irix 4.0.5.
  17. |> 
  18. |> #define Concat(a,b) a/**/b
  19. |> filename: /usr/lib/Concat(lib,X11.a)
  20. |> 
  21. |> cpp produces: filename: /usr/lib/ libX11.a
  22. |>                                  ^extra space
  23. |> I can't avoid this extra space!
  24. |> 
  25. |> acpp doesn't do this, but for several reasons i cannot switch to acpp.
  26. |> 
  27. |> Is this a bug or a feature?
  28. |> 
  29.  
  30. Changing /**/ to a space is a feature of acpp, not cpp.
  31.  
  32. The ANSI-C standard committee decided that /**/ should become a space as
  33. was specified in K&R C and not become a space as was the adopted practice
  34. of some versions of cpp.  (See the ANSI-C standard "Rationale" section).
  35.  
  36. ANSI-C defines a ## operator for concatenation.
  37.  
  38. If you change your define to the following, all will work well under
  39. both Classic cpp and the ANSI-C cpp (acpp):
  40.  
  41. #ifdef __ANSI_CPP__
  42. #define Concat(a,b) a ## b
  43. #else
  44. #define Concat(a,b) a/**/b
  45. #endif
  46.  
  47. Don't forget, under IRIX 4.0.5, the default C compiler is the ANSI-C compiler
  48. and not the Classic C compiler.  To get Classic C, you must use -cckr.
  49.  
  50.  
  51. -- 
  52.  
  53.     __   * __   _  __  ___            
  54.    /  \ / / /  / \/  \/   \     He was a man like any other man, however, not
  55.   /    /  \/  /  /\  /    /    quite like any other man.
  56.   \___/\__/\_/  /_/ / \__/    
  57.                *        
  58.