I have matrix declaration implemented as follows:
int var_porcenComun;
int var_porceninv;
uint32_t pointers[] = {
(uint32_t)&var_porcenComun, 9999999,
(uint32_t)&var_porceninv, 999999
};
Those are all global variables. This code compiles fine.
Basically, the "pointers" holds the address of a variable and the maximum value it is supposed to hold.
My problem is that I have to add to this matrix a new variable, defined as uint64_t. Although the size of a pointer in my platform is 32 bits, I'd have to change the "pointers" to a uint64_t, because of the size of the variable. But when I do:
uint64_t pointers[] = {
(uint64_t)&var_porcenComun, 9999999,
(uint64_t)&var_porceninv, 999999
};
I get the following error:
: Error! E1054: Expression must be constant
Why is this error happening when I simply change the "pointers" type?
I'm using watcom 1.3 as compiler. Gcc and Visual Studio's have compiled fine this code.