Article View: gnu.gcc.help
Article #49664Re: realloc(null, some_positive_number)
From: Robert Andrew Ryan
Date: Wed, 12 Jan 1994 19:25
Date: Wed, 12 Jan 1994 19:25
16 lines
1563 bytes
1563 bytes
Excerpts from netnews.gnu.gcc.help: 12-Jan-94 realloc(null, some_positive.. mla@topdown.com (874*) > I am using gcc version 2.5.7. In one of my calls to realloc, the first > parameter happened to be NULL. As far as I can tell, a program > compiled with gcc will always return NULL from this call. According to > the 3 different C books I have, when the first parameter is NULL, it > should basically behave as malloc, i.e. allocate the memory requested if > possible. This is a function of your vendor's C library, not gcc. Possible solutions include using the GNU C library (but it is not widely ported yet), using a 3rd party malloc library (several monetarily free ones exist), or using your own realloc function as you suggested. -Rob
Technical Details
Message-ID:
<chB4v5q00gjONBVlAn@andrew.cmu.edu>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!bb3.andrew.cmu.edu!andrew.cmu.edu!rr2b+References:
<CJIyI8.n2n@topdown.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,bed32f990753bf29 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1994-01-12 13:19:03 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!bb3.andrew.cmu.edu!andrew.cmu.edu!rr2b+ From: Robert Andrew Ryan <rr2b+@andrew.cmu.edu> Newsgroups: gnu.gcc.help Subject: Re: realloc(null, some_positive_number) Date: Wed, 12 Jan 1994 14:25:57 -0500 Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Lines: 16 Message-ID: <chB4v5q00gjONBVlAn@andrew.cmu.edu> References: <CJIyI8.n2n@topdown.com> NNTP-Posting-Host: andrew.cmu.edu In-Reply-To: <CJIyI8.n2n@topdown.com>