Hello,
I have a question about the stdlib printf functions. If I use not "valid" floating point numbers, which is the case when memory is not initialized, then my snprintf function "hangs" (is looping internally). I have increased the heap to 500 and stack to 200. I am using CCS 5.1.1.00028 and MSP430. I tried compiler toos 4.0.0, 4.0.2, and 4.1.0 but nothing worked.
Do I have to provide some error callback functions? Where can I find detailed documentation about how to implement this functions?
Is this a bug?
If this is not a bug, how can I check if it is a valid floating point value?
Reproducible code:
void main(void) { char str[40]; volatile float test; ((char*)&test)[0] = 0x6d; ((char*)&test)[1] = 0x6d; ((char*)&test)[2] = 0; ((char*)&test)[3] = 0; while(1) { snprintf(str, 30, "%f", test); _NOP(); } }
Thanks,
Joachim