home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / programm / 8270 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.4 KB  |  40 lines

  1. Organization: Sponsored account, Mathematics, Carnegie Mellon, Pittsburgh, PA
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!bb3.andrew.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!da0g+
  3. Newsgroups: comp.sys.next.programmer
  4. Message-ID: <ofM_2yS00WA78Jzi5C@andrew.cmu.edu>
  5. Date: Fri, 22 Jan 1993 20:34:54 -0500 
  6. From: David Apfelbaum <da0g+@andrew.cmu.edu>
  7. Subject: Re: Memory Allocation Error
  8. In-Reply-To: <erich.727618096@alamo>
  9. Lines: 29
  10.  
  11. Excerpts from netnews.comp.sys.next.programmer: 21-Jan-93 Re: Memory
  12. Allocation Error by Erich S. Boleyn@alamo.mt 
  13. >   I have seen this problem many times.  It has always (so far at least)
  14. >been caused by attempting to call 'free' on a statically allocated string.
  15. >.....
  16. >   Basically, your answer is to just bite the bullet and fix the bad
  17. >code that technically shouldn't have worked anyway, even though SunOS
  18. >and a few others are permissive.
  19.  
  20.  
  21. ????
  22.  
  23. If this truly is the problem, there's a much easier, though far less
  24. "correct" solution:
  25.  
  26. (from "man cc")
  27.      -fwritable-strings
  28.           Store string constants in the writable data segment and
  29.           don't make them unique.  This is for compatibility with
  30.           old programs that assume they can write into string
  31.           constants.  Writing into string constants is a very bad
  32.           idea; "constants" should be constant.
  33.  
  34.  
  35. Remember, NeXT 'cc' is/was based around GNU's gcc.
  36.  
  37.         -David.
  38.  
  39.  
  40.