Mail Archives: djgpp/2002/02/14/08:00:13
CBFalconer wrote:
>
> Eli Zaretskii wrote:
> >
> > > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > > Newsgroups: comp.os.msdos.djgpp
> > > Date: Wed, 13 Feb 2002 18:08:10 GMT
> > >
> > > > And if unbuffered I/O is too slow, call setvbuf with a suitable buffer
> > > > instead. That should avoid the need to call malloc the first time printf
> > > > is called.
> > >
> > > Nope, that didn't do it.
> >
> > Sorry, I forgot that malloc is called in the startup code, so calling
> > setvbuf in `main' is too late.
> >
> > I guess the easiest way out of this mess is to use cprintf instead of
> > printf. Or move the setvbuf call into malloc itself, before the
> > first printf (with some kind of static flag, to do that only once).
>
> Well, back to the drawing board. Something that is isolated to
> the malloc module is preferable. I guess I will first look up
> cprintf.
cprintf avoids the blowups, but seems to pay no attention to
'\n'. The output has line feeds, without <cr>. Using it also
brings in a long startup delay.
I changed the output strings to terminate in \r\n, and now I get
bright patches of blue on the screen, with no output! However,
the program didn't crash and did terminate at least. Nothing in
the clib documentation about this behavior. Any further ideas?
So far all this is simply collecting the tools to investigate -
nothing whatsoever productive.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:uce AT ftc DOT gov (for spambots to harvest)
- Raw text -