The following snippet of code gives me an internal C11 error. I will appreciate any help in this regard. I am using uVision3 for ARM7 (Philips LPC2148 processor). This of course is a very simplified sample from a relatively large project. ----------------------------- void main(void) { unsigned long* ResultValue = 0; unsigned long DummyValue = 0; *ResultValue = (unsigned long long)1 - DummyValue; } ----------------------------- main.c(6): error C11: internal error: (asmgen - triple=T0023) ----------------------------- The error goes away if I replace the constant value "1" with a variable, or replace the variable "DummyValue" with a constant. Thanks, Akbar.
ULL
Thanks - so that's
*ResultValue = 1ULL - DummyValue;
Same error even if I do 1ULL instead of type casting it. The only workaround to this problem that I have found so far is to use a variable, assign it the value of constant and then use it in the expression. It works fine in that case. It may have something to do with the mixing of 64-bit constant with 32-bit variable. I did run a check on doing the same with 32-bit constant and 16-bit variable but that works fine. Andy, I may not have understood your question. Do you mean if I use 64-bit constants in the whole expression? In that case, it also works fine. Even if I replace the constant with variable and do the same typecasting, program compiles without errors.
You should switch to the RealView compiler, since this compiler has implemented all long long, float, and double float operations. See: http://www.keil.com/support/man/docs/uv3/uv3_ca_armtoolset.htm
"switch to the RealView compiler, since this compiler has implemented all long long..." Are you saying that CARM's implementation of 'long long' is incomplete?