[comp.sys.amiga] ZC 1.01 Problems

a218@mindlink.UUCP (Charlie Gibbs) (06/01/90)

In article <20742@snow-white.udel.EDU>
GWO110%URIACC.BITNET@brownvm.brown.edu (F. Michael Theilig) writes:

>     I reciently grabbed ZC off of FF314 and set it up.  Everything got
> set up properly and I created executable properly, but there is one
> annoying side effect.  It seems that ZC won't print out any text until
> a charage return is printed, i.e. when I do a printf with no ending
> n, I don't see the text until one is printed.

     Apparently console output is buffered for speed; the buffer is
dumped when you hit a newline character, or...

>     Is there any way around this?

     Yup.  Just say

        fflush (stdout);        /* or stderr or whatever */

Works fine for me in A68k.

>                                    Also, it seemed that parameters are
> not being taken wrong.  I define argv as *argv[], rather than **argv.
> I haven't looked into that problem thoroughly yet.  Anyone else find
> any problems?

     Jeff Lydiatt mentioned that one when he was working on it.
I found it easier to just switch to **argv.

Charlie_Gibbs@mindlink.UUCP
I'm trying to develop a photographic memory.

GWO110%URIACC.BITNET@brownvm.brown.edu (F. Michael Theilig) (06/01/90)

     I reciently grabbed ZC off of FF314 and set it up.  Everything got
 set up properly and I created executable properly, but there is one
 annoying side effect.  It seems that ZC won't print out any text until
 a charage return is printed, i.e. when I do a printf with no ending
 n, I don't see the text until one is printed.

     Is there any way around this?  Also, it seemed that parameters are
 not being taken wrong.  I define argv as *argv[], rather than **argv.
 I haven't looked into that problem thoroughly yet.  Anyone else find
 any problems?

 ----
      F. Michael Theilig  -  The University of Rhode Island at Little Rest
                            GWO110 at URIACC.Bitnet
                            GKZ117 at URIACC.Bitnet

"He is a borderline genius that experiences
 peridoic phases of abject stupidity."

aduncan@rhea.trl.oz.au (Allan Duncan) (06/14/90)

From article <20742@snow-white.udel.EDU>, by GWO110%URIACC.BITNET@brownvm.brown.edu (F. Michael Theilig):
> 
>      I reciently grabbed ZC off of FF314 and set it up.  Everything got
>  set up properly and I created executable properly, but there is one
>  annoying side effect.  It seems that ZC won't print out any text until
>  a charage return is printed, i.e. when I do a printf with no ending
>  n, I don't see the text until one is printed.
> 
>      Is there any way around this?  Also, it seemed that parameters are
>  not being taken wrong.  I define argv as *argv[], rather than **argv.
>  I haven't looked into that problem thoroughly yet.  Anyone else find
>  any problems?
> 

No, this isn't a ZC bug, the behaviour is the same for most printf's.

The reason is that to get maximum speed for console output, the buffer
used is (say) 512 bytes, but it will be flushed when it it gets a \n, or
there is a call to stdin.  If you want it to be flushed earlier, tell it
explicitly with  fflush(stdio).
Alternatively, if you have the library sources, you can create a
one-byte buffer case for stdio if the stream "isatty".  I don't know
what the ZC library is like, but the relevant routine is probably
something like "getbuffer".

Allan Duncan	ACSnet	a.duncan@trl.oz
		ARPA	a.duncan%trl.oz.au@uunet.uu.net
		UUCP	{uunet,hplabs,ukc}!munnari!trl.oz.au!a.duncan
Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.