This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: printf problem
Random guess. Assuming you are actually using
newlib's printf and have a test program of your
own construction, I have seen some architectures
where not including <stdio.h> would result in
printf doing weird things. I think it has to
do with not knowing printf takes variable arguments.
It is also possible that if you are truly on
a new architecture with a new gcc port, that
the variable arguments support is broken for
that port.
--joel
Yu Xuanwei wrote:
>
> ----- Original Message -----
> From: jw c <info2choijo@yahoo.com>
> To: <newlib@sourceware.cygnus.com>
> Sent: Wednesday, January 10, 2001 9:19 AM
> Subject: printf problem
>
> > Hello.
> > I'm porting newlib to a new cpu. I successfully
> > compiled gcc & newlib, but when I simulate printf
> > function, printf("%s\n", str) just prints "%s\n".
> >
>
> Which CPU and architecture?
>
> > printf("hello, world") works correct, it prints
> > "hello, world", but
> >
> > char str[20]="hello, world";
> > printf("%s\n", str);
> >
> > prints "%s\n" itself.
> >
> > Can someone tell me why? Thank you.
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Photos - Share your holiday photos online!
> > http://photos.yahoo.com/
> >
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985