How to get printf() output?

Ken Rose kenrose@tfb.com
Tue Sep 23 21:24:00 GMT 2003


Toralf Lund wrote:
> Can someone repeat for me what I should do to get printf() to work when 
> linking with newlib, but not libgloss? I was under the impression that 
> write() would be called eventually, but it looks like it isn't. I've 
> tried step-tracing the printf execution via the ROM monitor to find out 
> what is going on, but it's a bit hard to follow...
> 
> Just to make it clear: I have provided custom version all routines 
> necessary to link the application correctly, including read(), write(), 
> open() and close(). I'm linking with libc, libm and crt0.o, but not 
> libgloss or similar.

If isatty() claims that stdout isn't a tty, then printf will buffer the 
output.  The quick way to test this theory is to do fflush(0) to push 
all the putput out.

  - ken


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list