This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: A question about printf
- To: Andrea Acquaviva <acquaviva at deis dot unibo dot it>, "ecos-discuss at sources dot redhat dot com" <ecos-discuss at sources dot redhat dot com>
- Subject: Re: [ECOS]A question about printf
- From: "Lewin A.R.W. Edwards" <larwe at larwe dot com>
- Date: Mon, 11 Dec 2000 16:16:28 -0500
Hello Andrea,
>I have a question about printf().
>I noted that if I make two consecutive call to prinf or fprintf
>functions in my executables (also a simply modified hello world program), the
>execution stops at the second function call, namely the second printf()
>doesn't works at all.
I was debugging some SmartMedia code today in eCos and noticed that the
following code:
int i;
for (i=0;i<4096;i++) {
int k;
// some processing which assigns a value to k
printf("** Found logical block %d at physical block %d ",i, k);
}
would skip some of the last bytes of the output. However, if I added \n to
the end of the printf format string, then all output is OK.
Looks like a buffering issue of some kind perhaps, try adding \n to the end
of your printf strings and see if that fixes it.
=== Lewin A.R.W. Edwards (Embedded Engineer)
Work: http://www.digi-frame.com/
Personal: http://www.zws.com/ and http://www.larwe.com/