This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: A question about printf
- To: "Lewin A.R.W. Edwards" <larwe at larwe dot com>
- Subject: Re: [ECOS]A question about printf
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Mon, 11 Dec 2000 21:46:18 +0000
- Cc: 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>
- Organization: Red Hat UK Ltd.
- References: <4.3.2.7.2.20001211161348.00a8b9e0@larwe.com>
"Lewin A.R.W. Edwards" wrote:
>
> 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.
This is completely correct for line-buffered output and is mandated by the
ISO C standard. There is no bug in this case.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault