home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 11017 < prev    next >
Encoding:
Text File  |  1993-01-07  |  3.5 KB  |  93 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!spool.mu.edu!wupost!newsfeed.rice.edu!rice!news.Rice.edu!rich
  3. From: rich@Rice.edu (& Murphey)
  4. Subject: Re: [386bsd] gcc 2.3.2 compile problems
  5. In-Reply-To: blymn@awadi.com.au's message of 28 Dec 92 18:26:37
  6. Message-ID: <RICH.93Jan6215050@superego.Rice.edu>
  7. Sender: news@rice.edu (News)
  8. Reply-To: Rich@rice.edu
  9. Organization: Department of Electrical and Computer Engineering, Rice
  10.     University
  11. References: <dhess.724812183@Xenon.Stanford.EDU> <BLYMN.92Dec27161320@siren.awadi.com.au>
  12.     <BLYMN.92Dec28182637@siren.awadi.com.au>
  13. Date: Thu, 7 Jan 1993 03:50:50 GMT
  14. Lines: 77
  15.  
  16. >>>>> In article <BLYMN.92Dec28182637@siren.awadi.com.au>, blymn@awadi.com.au (Brett Lymn) writes:
  17. Brett> NNTP-Posting-Host: siren.awadi.com.au
  18.  
  19. >>>>> On 27 Dec 92 16:13:19, blymn@awadi.com.au (Brett Lymn) said:
  20. Brett> NNTP-Posting-Host: siren.awadi.com.au
  21.  
  22. >>>>> On 20 Dec 92 00:43:03 GMT, dhess@Xenon.Stanford.EDU (Drew William Hess) said:
  23.  
  24. D> I'm having problems getting gcc 2.3.2 to compile under 386bsd.  It's choking
  25. D> on enquire.c, line 2303, and complaining about a floating point constant
  26. D> being out of range.  Can someone please post or email me a fix?  Thanks.
  27.  
  28. Brett> I would not worry about it too much, if you have a look at the
  29. Brett> comments in the .h file enquire generates you will see that the errors
  30. Brett> that it has detected are rather infesteminal (ie the order of 1e-308)
  31. Brett> so I suspect the rounding is wrong rather than anything else more
  32. Brett> serious.
  33.  
  34. Brett> Apart from that gcc 2.3.2 works fine, I have compiled X with it with
  35. Brett> only one problem, in /usr/include stdlib.h there is the following
  36. Brett> ifdef:
  37.  
  38. Brett> Thanks to L. Jonas Olsson for suggesting:
  39.  
  40. Brett> #if defined(alloca) && (alloca == __builtin_alloca)
  41. Brett> #if __GNUC__ < 2 /* do not define for gcc 2.3.2 */
  42. Brett> void    *alloca __P((int));     /* built-in for gcc */
  43. Brett> #endif
  44. Brett> #else
  45. Brett> void    *alloca __P((size_t));
  46. Brett> #endif /* __GNUC__ */
  47.  
  48. Brett> Which will ifdef out the alloca definition for gcc 2.x but not the gcc
  49. Brett> 1.39 (needed for the kernel rebuilds by the unadventurous ;-)
  50.  
  51. Brett> --
  52. Brett> Brett Lymn
  53.  
  54. Bruce Evans and I discussed the alloca patch at length and after going
  55. back and forth on various forms such as that above settled on the
  56. following:
  57.  
  58. diff -c stdlib.h.dist stdlib.h
  59. *** stdlib.h.dist    Mon Jul 13 08:24:09 1992
  60. --- stdlib.h    Thu Dec 31 14:05:51 1992
  61. ***************
  62. *** 102,108 ****
  63.   #endif /* not ANSI */
  64.   
  65.   #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
  66. ! void    *alloca __P((size_t));    /* built-in for gcc */
  67.   extern     char *optarg;            /* getopt(3) external variables */
  68.   extern     int optind;
  69.   extern     int opterr;
  70. --- 102,110 ----
  71.   #endif /* not ANSI */
  72.   
  73.   #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
  74. ! #ifndef alloca
  75. ! void    *alloca __P((size_t));
  76. ! #endif
  77.   extern     char *optarg;            /* getopt(3) external variables */
  78.   extern     int optind;
  79.   extern     int opterr;
  80.  
  81.  
  82. This works around the inconsistency between alloca declarations in
  83. stdlib.h and that internal to gcc 1.39.  It's also what has been
  84. proposed for inclusion in the next XFree86 release.
  85.  
  86. The declaration needs to be avoided only when using gcc 1.39 and one
  87. has '#define alloca __builtin_alloca'.  This is because the gcc 1.39's
  88. internal declaration is 'void __builtin_alloca(int)'.
  89.  
  90. gcc 2.x's declaration is 'void __builtin_alloca(size_t)', so the
  91. declaration is OK whether you have #defined alloca or not.  Both
  92. versions of gcc provide the declaration internally.  Rich
  93.