snprintf() in rtems

Joel Sherrill joel.sherrill at OARcorp.com
Mon Feb 4 20:09:19 UTC 2002


Gene are you using a recent toolset with the -msoft-float
multilib variant?

find /opt/rtems/i386-rtems -name libc.a

If you are seeing FP opcodes aon an i386ex, then it could be
an exception that is taking your system down.

--joel

"Smith, Gene" wrote:
> 
> Should this code fragment work?
> 
> {
> char    sendstr[21];
> float pi = 3.1415;
> 
> snprintf(sendstr, sizeof sendstr -1, "%f", pi);
> }
> 
> It seems like snprintf never returns and the system hangs.
> I am able to use snprintf with interger formats with no problem.
> The code actually does no actual math operations, except for this
> type of formatting.
> 
> bsp is approx. 386ex with no math or fp library that I know of.
> 
> Tried printf and it does the same thing.
> 
> I can see f*** (floating point) opcodes in code, e.g., _vf_printf_r from
> newlib.
> 
> Anybody know?
> 
> -gene

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list