home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / gcc / bug / 3139 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.2 KB  |  53 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!eng.SUn.COM!Todd.CLayton
  3. From: Todd.CLayton@eng.SUn.COM (Todd Clayton)
  4. Subject: GCC preprocessor bug ?
  5. Message-ID: <9301080210.AA22873@oconee.Eng.Sun.COM>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 8 Jan 1993 02:10:44 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 40
  12.  
  13. I'm not sure this is a bug, but Sun cc behaves differently than gcc on this
  14. simple testcase. I thought it would be best to report it and let the
  15. pros figure it out. In the simple testcase below I thought "-x" should 
  16. should be treated as separte preprocessing tokens in the macro "Blk".
  17. That is "-" and "x" are seperate tokens and should not be merged as
  18. gcc does.
  19.  
  20. -Todd
  21.  
  22. oconee:tmp% gcc -v
  23. Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos5.1/2.3.3/specs
  24. gcc version 2.3.3
  25. oconee:tmp% cat foo.c
  26. #define Blk(x)          (-x)
  27.  
  28.  
  29. foo()
  30. {
  31.     Blk(-1);
  32. }
  33. oconee:tmp% gcc -E foo.c
  34. # 1 "foo.c"
  35.  
  36. foo()
  37. {
  38.              (--1) ;
  39. }
  40. oconee:tmp% cc -E foo.c
  41. # 1 "foo.c"
  42. # 6
  43.  
  44.  
  45. foo()
  46. {
  47.      ( - - 1 ) ;
  48. }
  49. #ident "acomp: (CDS) SPARCompilers 2.0.1 03 Sep 1992"
  50. oconee:tmp% 
  51.  
  52.  
  53.