We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
#include <string.h> #include <stdio.h> #include <LPC214x.H> volatile int rc=0; volatile float A0 = 15.2, B0 = 0.152; int tst(const int iprivod,int id0, float iV0) { int iS0, iS2, it0, idx1, idt, iS_m=0x1234, it_m; iS_m = (int)(A0 * A0 /B0); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //Locals window show here 0x40000468 for iS_m //and 0x000005F0 if next line is commented iS_m = A0 * A0 ; it_m = A0/B0+0.5; id0 = iS_m; if(iV0 < 0.) { it0 = iV0/B0+0.5; } else { iS0 = iV0*iV0/(B0*2.); } if(id0 <= iS0) { if(iprivod > 0) { idx1 = 123; } else idt = 321;//it_m; return 0; } iS2 = (id0 + iS0); if(0x1235 > iS_m) { return iS_m; } return 2; } int main (void) { while(1) { rc= tst(1,1520, 0.); } }
I mean entity that run on Ctrl+F5 from mVison3.
I know that all floating point operations are Library calls , but I am sure that I use float point operation only in one place, so in general meaning(IBM PC's thread-safe general programming) this code is not re-entrant. Well, it may be not-interrupt-safe, then it should be mention somewere in docs, isn't it ?
I don't see or can't find this point in RV complier and library docs, the word "reentrancy" is mentioned only 3 times on page 5-9 without any regards to float point operations. May be I am wrong and missing some point ?