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


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: Missing sprintf for SH1 ?


I am sorry that a reply is overdue.

Include was specified.
-mhitachi was attached to the compile option when improving the option.
It succeeded, when removing this option.
Thank you.

jun
> -----Original Message-----
> From: J. Johnston [mailto:jjohnstn at redhat dot com]
> Sent: Saturday, April 12, 2003 12:14 AM
> To: jun at cew dot co dot jp
> Cc: newlib at sources dot redhat dot com
> Subject: Re: Missing sprintf for SH1 ?
> 
> 
> Are you including <stdio.h> in your test case?  Without it, the prototype
> for sprintf() will be defaulted to take int arguments and return an int.
> The sprintf() function in reality expects a variable argument list and you
> need that noted in the prototype.
> 
> If you are specifying #include <stdio.h>, how did you configure and what
> exactly did you specify to compile your test case?
> 
> -- Jeff J.
> 
> 山田 淳 wrote:
> > Hello.
> > 
> > Although I am evaluating on CPU board of SH1 SH7034 of Hitachi, sprintf function does not operate correctly.
> > buf after execution is still NULL.
> > If an assembler is seen, the address is copied to buf, without the second parameter (fmt) going into a register 5 (r5) 
> correctly.
> > Why does it operate in this way?
> > What should be changed into making it operate correctly?
> > Please let me know someone.
> > I ask of you.
> > cygwin dll 1.3.15-2
> > binutils 2.13.1
> > gcc-core 2.95.3
> > newlib 1.11.0 
> > 
> > void    function( void ){
> >     char    buf[30];    
> >   char    *title = "test\r\n";
> >     char    *fmt = "%s";
> >     int     ret;    
> > 
> >   memclr(buf,sizeof(buf));
> >     ret = sprintf(buf, fmt, title); 
> > 
> > }
> > 
> > jun yamada
> > 
> > 
> 
> 


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