Greetings, dumb question here.
First of all, the setup:
ccstudio 4.1.3, building a static lib for a C6748 DSP with CGT 6.1.9
Here is some code that generates a compiler error: (I've simplified it for discretion purposes, but this simple code still generates the error)
#define NUM1 9.1f
#define NUM2 3.0f
#define A_NUMBER (Uint32)(NUM1/NUM2)
Then sometime later I try to declare an array:
Uint32 myArray[A_NUMBER];
And the compiler gives the error that the expression ( int myArray[A_NUMBER] ) must have an integral type. This same code compiles just fine in MS Visual Studio. Obviously the compiler is not seeing the A_NUMBER constant as an integer value (despite the Uint32 casting) and complaining about the declaration. How do I get this to compile? Changing NUM1 and NUM2 to integers is not an option as in my real code, these constants are used in other places as float values. Thanks in advance.