Hi,
My problem is that I have integer constants coded as compile-time constant floating equations to avoid having to use the floating point library... let me explain...
Take some code that does not use floating point operations - say:
void main(void) { unsigned int i = 1000; for (; i; i--) ; }
Under Projects / Options / C/C++ / Misc Controls: add the directive:
--fpu=none
since we don't need FPU support.
Like this, the program will compile.
Now, ask the compiler to do some compile-time floating-point calculation that results in an integer - insert at head of file:
unsigned int j = (unsigned int)(1.0*3.0);
The RealView compiler refuses to compile the line, even though we don't need FP support at run-time.
Is there a way round this?
Sorry I believe I got my "rounding" (or truncating) wrong. But these numbers do come out to be EXACT integers. There should be no need to use floating point.