I get runtime Access Violation when I try to run the following line:
float x;
x = 29.600;
printf("%f", x);
This is a *.C
file within CPP project, running in kernel space.
OS is vxworks 6.7
On the other hand, integer values are being printing out just fine. Also if it might help, the float values are print out for single time.During the initialization of the full application. Task has floating point support, so that should not be problem as well. Same section of code is running fine on windows platform/MVCE
NOTA BEFORE CLOSING BECAUSE OF NO MVCE OR EVIDENTLY CORRECT C CODE :
This question is about kernel mode on an embedded system. A MVCE should at least contains kernel code and all the kernel developping environment reference. Also in kernel developpement it is not really surprising because of kernel limitation for performance improvement that some perfectly correct code breaks in the context.
This worked for me:
In the Kernel configuration (project explorer), windriver workbench explicitly provides option to add support for floating point math , this solved the whole issue.