🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2274

Re: Memory Allocation Error

#2274
From: David Apfelbaum
Date: Sat, 23 Jan 1993 01:34
27 lines
1518 bytes
Excerpts from netnews.comp.sys.next.programmer: 21-Jan-93 Re: Memory
Allocation Error by Erich S. Boleyn@alamo.mt 
>   I have seen this problem many times.  It has always (so far at least)
>been caused by attempting to call 'free' on a statically allocated string.
>.....
>   Basically, your answer is to just bite the bullet and fix the bad
>code that technically shouldn't have worked anyway, even though SunOS
>and a few others are permissive.


????

If this truly is the problem, there's a much easier, though far less
"correct" solution:

(from "man cc")
     -fwritable-strings
          Store string constants in the writable data segment and
          don't make them unique.  This is for compatibility with
          old programs that assume they can write into string
          constants.  Writing into string constants is a very bad
          idea; "constants" should be constant.


Remember, NeXT 'cc' is/was based around GNU's gcc.

        -David.
Technical Details
Message-ID: <ofM_2yS00WA78Jzi5C@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!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+

Show Full Headers
Complete Article Headers
Organization: Sponsored account, Mathematics, Carnegie Mellon, Pittsburgh, PA
Path: arc1-ca.pugleaf.net!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+
Newsgroups: comp.sys.next.programmer
Message-ID: <ofM_2yS00WA78Jzi5C@andrew.cmu.edu>
Date: Fri, 22 Jan 1993 20:34:54 -0500 
From: David Apfelbaum <da0g+@andrew.cmu.edu>
Subject: Re: Memory Allocation Error
In-Reply-To: <erich.727618096@alamo>
Lines: 29