home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / misc / 18672 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  3.3 KB

  1. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!bloom-picayune.mit.edu!news
  2. From: patl@golem.mit.edu (Patrick J. LoPresti)
  3. Newsgroups: comp.sys.next.misc
  4. Subject: Re: 3.0's C compiler ?
  5. Message-ID: <1992Aug14.051526.17919@athena.mit.edu>
  6. Date: 14 Aug 92 05:15:26 GMT
  7. References: <1992Aug13.142923.4575@cube.handheld.com>
  8. Sender: news@athena.mit.edu (News system)
  9. Organization: Massachvsetts Institvte of Technology
  10. Lines: 71
  11. Nntp-Posting-Host: monolith.mit.edu
  12.  
  13. In article <1992Aug13.142923.4575@cube.handheld.com> jmd@cube.handheld.com (Jim  
  14. De Arras) writes:
  15. > In article <1992Aug12.042213.29139@dtint.uucp> nevin@dtint.dtint.com writes:
  16. > > So, what's the REAL gnu version of the NeXT compiler?
  17. > > 
  18. > > Alright, you might find a couple of other differences between the
  19. > > C compiler shipped in 3.0 and the latest GNU version, but I for
  20. > > one have no idea of what they might be.  Anyone else care to
  21. > > enlighten us?
  22. > > 
  23. > > 
  24. > Per GNU, (check the newsgroups!) all 2.x releases are beta, and not ready for  
  25. > prime time!
  26. > Jim
  27.  
  28. While this is technically true, we have found the 2.2.2 release of GCC to be AT  
  29. LEAST as reliable as the NeXTStep 3.0 cc.  GCC has an extensive set of beta  
  30. testers and talented developers, and is generally quite robust.  The only  
  31. serious problems are with ports to new architectures, and with experimental  
  32. optimizations (e.g., "-funroll-loops").
  33.  
  34. Releases 1.9x from GNU were alpha releases of the GCC 2 compiler.  I do not  
  35. know whether the 1.93 from "cc -version" under 3.0 is derived from this  
  36. convention.
  37.  
  38. GCC 2.2.2 has minor fixes compared to GCC 2.2, which has major fixes compared  
  39. to GCC 2.0.  Always get the latest version :-).
  40.  
  41. Here is my attempt to sketch the differences between the NeXT 3.0 cc and the  
  42. current GCC.
  43.  
  44. Unlike GCC 2.2.2, NeXT cc has:
  45.  
  46. - New Objective-C keywords, like "@protocol" and "@class"
  47. - "id" as a built-in type, not a "typedef void *"
  48. - cpp modifications to support the "new and improved" header file structure,  
  49. plus support for '#include "m68k/" "foo.h"' (for example)
  50. - Precompiled headers
  51. - "Literal NXConstant String Objects"; i.e., syntactic sugar for creating  
  52. strings (This [finally] gives C a *real* string type, complete with fancy  
  53. operators.  It should also facilitate the move to international character sets.   
  54. Maybe.)
  55. - More new Objective-C keywords, like "@public" and "@private"
  56.  
  57.  
  58. Unlike NeXT cc, GCC 2.2.2 has:
  59.  
  60. - Computed gotos
  61. - Arrays of labels
  62. - Explicit initialization of array and structure elements; for example, "int  
  63. a[6] = { [4] 30, [2] 20 };" is the same as "int a[6] = {0, 0, 20, 0, 30, 0};".   
  64. "NXPoint p = { y: 2, x: 10};" will do the obvious.
  65. - Case ranges, like "case 1 ... 40:"
  66. - A somewhat better optimizer
  67.  
  68. NOTE: This information is based on the NS 3.0pr1 C compiler.  It is probably  
  69. incomplete, and may well be inaccurate with respect to the shipped version of  
  70. NS 3.0.
  71.  
  72. Mat Hostetter (mjhostet@athena.mit.edu) and I hacked up the GCC 2.2.2  
  73. preprocessor to allow us to compile C programs under NS 3.0pr1.  We did not  
  74. attempt to incorporate the new Objective-C keywords.  So we can currently  
  75. compile C programs, but not Objective-C (some ObjC header files use the new  
  76. keywords).
  77.  
  78. Perhaps GNU will incorporate the new ObjC features into GCC in the near future.   
  79. Let us hope so.
  80.  
  81. - Pat
  82.