home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / bsd / 10663 < prev    next >
Encoding:
Text File  |  1992-12-27  |  3.6 KB  |  92 lines

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!hsdndev!newsfeed.rice.edu!rice!news.Rice.edu!rich
  2. From: rich@Rice.edu (& Murphey)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: [386bsd] gcc 2.3.2 compile problems
  5. Message-ID: <RICH.92Dec27171213@superego.Rice.edu>
  6. Date: 27 Dec 92 23:12:13 GMT
  7. References: <dhess.724812183@Xenon.Stanford.EDU> <BLYMN.92Dec27161320@siren.awadi.com.au>
  8. Sender: news@rice.edu (News)
  9. Reply-To: Rich@rice.edu
  10. Organization: Department of Electrical and Computer Engineering, Rice
  11.     University
  12. Lines: 77
  13. In-Reply-To: blymn@awadi.com.au's message of 27 Dec 92 16:13:19
  14.  
  15. >>>>> In article <BLYMN.92Dec27161320@siren.awadi.com.au>, blymn@awadi.com.au (Brett Lymn) writes:
  16. >>>>> On 20 Dec 92 00:43:03 GMT, dhess@Xenon.Stanford.EDU (Drew William Hess) said:
  17. D> I'm having problems getting gcc 2.3.2 to compile under 386bsd.  It's choking
  18. D> on enquire.c, line 2303, and complaining about a floating point constant
  19. D> being out of range.  Can someone please post or email me a fix?  Thanks.
  20.  
  21. Brett> I would not worry about it too much, if you have a look at the
  22. Brett> comments in the .h file enquire generates you will see that the errors
  23. Brett> that it has detected are rather infesteminal (ie the order of 1e-308)
  24. Brett> so I suspect the rounding is wrong rather than anything else more
  25. Brett> serious.
  26.  
  27. Brett> Apart from that gcc 2.3.2 works fine, I have compiled X with it with
  28. Brett> only one problem, in /usr/include stdlib.h there is the following
  29. Brett> ifdef:
  30.  
  31. Brett> #if defined(alloca) && (alloca == __builtin_alloca)
  32. Brett> void  *alloca __P((int));     /* built-in for gcc */
  33. Brett> #else
  34. Brett> void    *alloca __P((size_t));
  35. Brett> #endif /* __GNUC__ */
  36.  
  37. Brett> You have to comment out the definition of alloca like this:
  38.  
  39. Brett> #if defined(alloca) && (alloca == __builtin_alloca)
  40. Brett> /* void  *alloca __P((int));     /* built-in for gcc */
  41. Brett> #else
  42. Brett> void    *alloca __P((size_t));
  43. Brett> #endif /* __GNUC__ */
  44.  
  45. You've patched your stdlib.h with the patch supplied with XFree86 1.1.
  46. More on that below.
  47.  
  48. Brett> Otherwise gcc gets confused and will not use the builtin alloca.
  49. Brett> Apart from this X compiles without a hitch and it seems (to me at
  50. Brett> least) a bit faster (not much) and a little bit smaller (again not
  51. Brett> much).  I have not found any problems with commenting out the alloca
  52. Brett> definition but I am not happy about doing it, anyone got a better
  53. Brett> suggestion?
  54.  
  55. Yep, The XFree86 core team has looked at this.
  56.  
  57. libc and gcc 2.x use 'alloca(size_t)' arg while gcc 1.x uses 'alloca(int)'.
  58. This breaks the stdlib.h patch we had included with the last XFree86
  59. release, so I've proposed we distribute the patch below with the next
  60. XFree86.
  61.  
  62. The new patch uses 'alloca(int)' only gcc 1.x is used and alloca is
  63. defined as __builtin_alloca.  
  64.  
  65. Any comments are welcome either here, to XFree86 core team
  66. <xfree86@physics.su.oz.au> or myself.  Rich@rice.edu
  67.  
  68.  
  69. *** stdlib.h.dist    Mon Jul 13 08:24:09 1992
  70. --- stdlib.h    Wed Dec 23 08:44:55 1992
  71. ***************
  72. *** 102,108 ****
  73.   #endif /* not ANSI */
  74.   
  75.   #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
  76. ! void    *alloca __P((size_t));    /* built-in for gcc */
  77.   extern     char *optarg;            /* getopt(3) external variables */
  78.   extern     int optind;
  79.   extern     int opterr;
  80. --- 102,112 ----
  81.   #endif /* not ANSI */
  82.   
  83.   #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
  84. ! #if defined(alloca) && (alloca == __builtin_alloca) && defined(__GNUC__) && (__GNUC__ < 2)
  85. ! void    *alloca __P((int));    /* built-in for gcc */
  86. ! #else
  87. ! void    *alloca __P((size_t));
  88. ! #endif /* __GNUC__ */
  89.   extern     char *optarg;            /* getopt(3) external variables */
  90.   extern     int optind;
  91.   extern     int opterr;
  92.