snprintf() in rtems

Smith, Gene Gene.Smith at sea.siemens.com
Mon Feb 4 19:50:24 UTC 2002


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



More information about the users mailing list