delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/02/21:30:09

From: "Tom St Denis" <tomstdenis AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SOL DOT 4 DOT 33 DOT 0107022250120 DOT 27631-100000 AT holyrood DOT ed DOT ac DOT uk> <200107022219 DOT SAA04299 AT envy DOT delorie DOT com> <Pine DOT SOL DOT 4 DOT 33 DOT 0107030043180 DOT 14632-100000 AT holyrood DOT ed DOT ac DOT uk> <200107022351 DOT TAA05124 AT envy DOT delorie DOT com> <T7807.80082$Mf5 DOT 22355219 AT news3 DOT rdc1 DOT on DOT home DOT com> <200107030106 DOT VAA05723 AT envy DOT delorie DOT com>
Subject: Re: malloc() problem, DJDEV 203
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2462.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Message-ID: <Y1907.80592$Mf5.22484236@news3.rdc1.on.home.com>
Date: Tue, 03 Jul 2001 01:16:40 GMT
NNTP-Posting-Host: 24.112.8.23
X-Complaints-To: abuse AT home DOT net
X-Trace: news3.rdc1.on.home.com 994123000 24.112.8.23 (Mon, 02 Jul 2001 18:16:40 PDT)
NNTP-Posting-Date: Mon, 02 Jul 2001 18:16:40 PDT
Organization: Excite AT Home - The Leader in Broadband http://home.com/faster
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"DJ Delorie" <dj AT delorie DOT com> wrote in message
news:200107030106 DOT VAA05723 AT envy DOT delorie DOT com...
>
> > > No, there are far too many programs that expect malloc(0) to succeed,
> > > even if the standard allows it to fail.
> >
> > While I agree that seems practical it isn't "a good thing".
>
> Why?  The standard allows it to fail, but it also allows it to
> succeed.  Why shouldn't we return a usable pointer to a zero-length
> (well, 8 byte length) buffer?
>
> I'd rather djgpp not be on the list of systems that gratuitously cause
> problems for the user, when it's just as easy to do something useful
> instead.

Oh I didn't know it was allowed to return a pointer to 0-bytes.

Personally I would see that as a big nono, but who am I to say!

Tom


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019