This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Problem with printf
- From: "Sidharth Jandhyala" <sidharth at clarinox dot com>
- To: <ecos-discuss at sources dot redhat dot com>
- Cc: <gokhan at clarinox dot com>
- Date: Tue, 18 May 2004 17:43:10 +1000
- Subject: [ECOS] Problem with printf
- Organization: Clarinox Pty Ltd.
- Reply-to: <sidharth at clarinox dot com>
Hi,
I am having a peculiar problem with printf. I noticed that a newline '\n'
must be placed at the end of each printf statement to work. How do I get
around this problem? Here is s sample code
I am using the eb40A board and debugging using arm-elf-insight.
//---------------------------------------------------------
# include <cyg/kernel/kapi.h>
# include <stdio.h>
# include <stdlib.h>
int main (int agrc, char * argv[])
{
printf("1.HEllo world..........\n");
printf("\n2.Hello world again");
printf("3.Hello world again");
} //End main
//---------------------------------------------------------
The output is
//---------------------------------------------------------
1.HEllo world..........
//---------------------------------------------------------
Why has eCos been implemented such that the '\n' must be included at the end
of the printf statement. Is there a way to avoid this characteristic. Is
there a way to flush the print buffers other than looking for the '\n'.
Thanks in advance.
Regards,
Sidharth
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss