This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a question about libc printf


> Hi,
>     I am not quite sure this is the right mailing list for my question,
> but this is the only list I know about newlib.
>     I am porting newlib to a ppc405 based board and implementing some libc
> hooking up routines like write(). In write() I call a UART driver to print
> out a string, but it seems that printf() has some buffering mechanism
> built in, so if I call printf("hello \n") ir works; but if I call
> printf("hello "), there is nothing coming out.
>    Could you point me which tricky point I missed?
>
> thanks a lot.

You might try reading the man pages for the fflush() and setvbuf() C
library functions.

These functions, as well as the way printf is behaving, are mandated by
the POSIX.1a spec, so all POSIX-compliant standard C libraries should
behave the same way.  (Mentioned only because I've never worked with
newlib, but I know the glibc, as well as Linux's older libc4 and libc5,
implementations of these functions conform strictly to POSIX.)


                               ------Carl 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]