Odd Compiler Error_
vining
Posts: 4,368
DEFINE_VARIABLE VOLATILE CHAR cTX_Queue[HVAC_ZONES * 128] ; or DEFINE_VARIABLE VOLATILE CHAR cTX_Queue[HVAC_ZONES * 64] ;results in this:
ERROR: file\path...... C10219: Array [CTX_QUEUE] must have an initializer if bounds are not specified
While the same thing with a number from 1-63 or 65-127 or 129-256 compiles just fine. I didn't actually try every number but everything I did try other than 64 or 128 did work.
HVAC_ZONES is an integer constant of 4.
0
Comments
Edit: I re-read your post and now understand what you are saying... it was the number and not the constant that it didn't like. That's pretty weird!
You can change HVAC_ZONES and/or your multiplier to any numbers but if when you multiply the two and the result is a multiple of 256 the compiler chokes. If it's not a multiple of 256 the compiler is happy.
Odd...
Odd. As in, make HVAC_ZONES an odd number.
Paul
DEFINE_VARIABLE
VOLATILE CHAR cTX_Queue[(HVAC_ZONES * 128) + (256 - 256)] ;
and it will compile.
credits to AMX support Germany for this workaround.
The above compiles fine including the last 3 constants but this next line doesn't: The compiler throws this error: So I just comment it out and use: Obviously it defeats the prupose of going through all this crap.
If they figure it out I'll buy them ein bier at the next Kieler Woche. Actually not since I don't drink anymore and I won't be going to Kiel. The idea is very tempting though.
Thanks for checking it.
Still didn't work on my system so I started playing around.
This worked: and then this worked: so I thought WTF! I then figured maybe because these constants that worked weren't actually used in any later declarations so I went to the first place the non working constant was used and changed it to a working constant: but that didn't break the constant now that is was actually used but I didn't give up and stepped through the code and changed where HWI_TOTAL_OUTPUTS was used one at a time and it turns out that it breaks here. if I change that to a constant declared with out a constant used with a math operation it works but if I use a constant declared using a constant and a math operation it doesn't.
Using HWI_TOTAL_OUTPUTS everywhere else in the code works fine but not in the structure "type" declarations. This is an old issue that I gave up on long ago so it doesn't bother me.