home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / misc / discuss / 4014 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  3.6 KB

  1. Xref: sparky gnu.misc.discuss:4014 comp.sys.sgi:18113
  2. Newsgroups: gnu.misc.discuss,comp.sys.sgi
  3. Path: sparky!uunet!stanford.edu!microunity!brendan
  4. From: brendan@microunity.com (Brendan Eich)
  5. Subject: Re: makefile for gnu make on SGI
  6. Message-ID: <1992Dec16.224421.2340@microunity.com>
  7. Sender: usenet@microunity.com (news)
  8. Nntp-Posting-Host: atm.microunity.com
  9. Organization: MicroUnity Systems Engineering Inc.
  10. References: <1992Dec16.000738.12900@microunity.com> <19921216111143SEB1525@MVS.draper.com>
  11. Date: Wed, 16 Dec 1992 22:44:21 GMT
  12. Lines: 71
  13.  
  14. In comp.sys.sgi, "Stephen E. Bacher" <seb1525@mvs.draper.com> writes:
  15. | Irix Release 4.0.1 System V (which is where I did the build)
  16. | appears to have __builtin_alloca, as shown in /usr/include/alloca.h,
  17. | which is why I used -Dsparc (which doesn't trigger anything else in
  18. | this particular make).  Is this OK to use, or do I still need to get
  19. | the GNU alloca?
  20.  
  21. I think the Irix __builtin_alloca works only in certain contexts.
  22. Someone should double-check my memory, but I believe you can't
  23.  
  24.     array[i] = alloca(1024);
  25.  
  26. nor can you
  27.  
  28.     call_a_function(alloca(1024));
  29.  
  30. There may be other restrictions.  If the man page doesn't treat them,
  31. the release notes may.  Or you could enquire on comp.sys.sgi -- Dave
  32. Anderson will have the answer.
  33.  
  34. Rather than worry, I just grabbed gcc alloca.c.
  35.  
  36. | ># Install make setgid to this group so it can read /dev/kmem.
  37. | ># [ Irix allows group sys to read /dev/kmem.  /be ]
  38. | [...]
  39. | >group = sys
  40. | Right.  However, I notice that Irix allows me to do the chgrp to sys for
  41. | a setgid file from an unprivileged account!  Is this right?  Looks like
  42. | a huge hole to me.
  43.  
  44. No, this is the System V (as opposed to v7/BSD) behavior: you can give
  45. away files that you own to another owner/group.  You can't do this to
  46. files owned by other users or groups, of course.  It creates no security
  47. holes by itself (you can't give away trojan horses if system directories
  48. are protected and root has no . in its path; you can't give away a suid-
  49. [sgid]-to-yourself file without the suid bit being cleared).
  50.  
  51. | >I did change make.h to define SIGHANDLER as a pointer-to-void-function,
  52. | >not pointer-to-int, #ifndef __STDC__:
  53. | >
  54. | >#define SIGHANDLER      void (*)()
  55. | Is this critical?  I'd rather not do source code changes, as a matter
  56. | of general policy, unless absolutely required.
  57.  
  58. As the default SGI compilation mode in 4.0.x is -xansi, which fails to
  59. define __STDC__, this is necessary unless you add a -D__STDC__ to the
  60. defines macro.  If you define __STDC__ you get a slew of warnings like:
  61.  
  62. accom: Warning 182: main.c, line 324: void * and function pointers are not convertible to each other
  63.          if (((void * ) signal(((10     )), (void * ) ( (void * ) fatal_error_signal)))         == (void * )    ((SIG_PF)1) )   (void) ((void * ) signal(((10   )), (void * ) (         ((SIG_PF)1) ))) ;       else    fatal_signal_mask |= (1L << ((10        )-1)) ; ;
  64.        ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
  65.  
  66. I decided to hack the source, but if you don't mind warning storms, add
  67. the -D__STDC__.  In a future release, SGI's cc will define __STDC__ when
  68. given the (still likely to be default) -xansi option.  The lack of this
  69. define when using -xansi is now considered a mistake.
  70.  
  71. You could add -cckr to CFLAGS, but I wanted prototype checking.  It has
  72. helped turn out bugs when porting code often enough that I resist falling
  73. back on -cckr or gcc -traditional.
  74.  
  75. /be
  76. -- 
  77. -----
  78. Brendan Eich
  79. MicroUnity Systems Engineering, Inc.
  80. brendan@microunity.com
  81.