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

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lia.di.epfl.CH!simon
  3. From: simon@lia.di.epfl.CH (Simon Leinen)
  4. Subject: Re: gcc-2.3.3 - bug on SUN for (char *) within a struct
  5. Message-ID: <SIMON.93Jan8132348@liasg2.epfl.ch>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Ecole Polytechnique Federale de Lausanne
  8. References: <9301071447.AA12676@uk0x06.ggr.co.uk>
  9. Distribution: gnu
  10. Date: Fri, 8 Jan 1993 12:23:48 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 23
  13.  
  14. In article <9301071447.AA12676@uk0x06.ggr.co.uk> gml4410@ggr.co.UK
  15. (Lack Mr G M) writes:
  16.  
  17.         I wish to report a bug in gcc-2.3.3 on a SUN.
  18.  
  19.         I  have  built  gcc-2.3.3 on a Sun Sparcstation at SunOS4.1.1.  The
  20.    configure option was "sparc-sun-sunos4.1" and I  used  CFLAGS=-O  during
  21.    the makeing, which completed with no errors.
  22.  
  23.         The  following  simple  program dies with a segmentation fault.  It
  24.    runs correctly with gcc-2.3.3 on an SG Indigo, with Suns own cc compiler
  25.    (and with other c compilers on other platforms).
  26.  
  27. If there's a bug, then it's that the GCC-compiled binary on the SGI
  28. doesn't get the segmentation fault.  Your strcpy()'s are overwriting
  29. string constants, which are usually allocated in read-only space by
  30. GCC (as you can see by the ".text" directives preceding the ".ascii"
  31. directives for your string constants).  This is a deliberate design
  32. decision which improves VM performance.  If you want to turn this
  33. behaviour off, you can pass the "-fwritable-strings" option to GCC.
  34. --
  35. Simon.
  36.  
  37.