delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/03/02/15:15:19

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Sat, 02 Mar 2002 22:04:20 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp-workers AT delorie DOT com
Message-Id: <4331-Sat02Mar2002220420+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <3C8118C3.C4EF9685@yahoo.com> (message from CBFalconer on Sat, 02
Mar 2002 13:24:03 -0500)
Subject: Re: Malloc/free DJGPP code
References: <10203021522 DOT AA15526 AT clio DOT rice DOT edu> <3C8118C3 DOT C4EF9685 AT yahoo DOT com>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sat, 02 Mar 2002 13:24:03 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> 
> No great sweat doing that, but as I discovered early on malloc is
> used during initialization and if any errors occur then writing to
> stdout at least is fatal and useless.

It's fatal if you use buffered stdio functions.  If you use `write'
(or even `_write') instead, it's not fatal.  The crash message is
written using these methods, and you could do the same with some
additional text you print before you abort.

> If I have to put back in
> the debug printout mechanism for that feature the code will grow

Why do you think so?  The call to _write is already in startup code,
so you won't be bloating the code too much.

> I assume write to the stderr handle will work as well as write to
> the stdout handle (not fwrite to streams).

Yes.

- Raw text -


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