I've come across a situation where code hangs in sprintf (using %f). It was tricky to isolate the problem because it seemed to occur intermittingly.
The problem appears to be related to low dynamic memory (due to global variables) and use of floating point operations (emulated with Teensy 3.2)
Included is a small code example that demonstrates the issue.
Sprintf will hang after some number of floating point operations. I'm guessing that successive FP operations are in some way using up memory resources which eventually causes sprintf to hang.
I'm wondering if this could be a more general problem, in that libraries have memory requirements that result in elusive run time failures.
The problem appears to be related to low dynamic memory (due to global variables) and use of floating point operations (emulated with Teensy 3.2)
Included is a small code example that demonstrates the issue.
Sprintf will hang after some number of floating point operations. I'm guessing that successive FP operations are in some way using up memory resources which eventually causes sprintf to hang.
I'm wondering if this could be a more general problem, in that libraries have memory requirements that result in elusive run time failures.