R
Ross
I'm compiling some code over and over with no problems. The only
differences between the versions is slightly different constants that
are specific to various embedded devices that are getting loaded.
Suddenly I notice a certain value generates a warning. Here's the
low-down:
The specific instance of the "-6" in this phrase generates a warning:
const signed long tzerocal_A[] ={80000, 15000, -60000 }; //bad
with some experimenting, -50000, and -40000 are also not liked
All these other versions will compile fine
const signed long tzerocal_A[] ={80000, 15000, -70000 }; //fine
const signed long tzerocal_A[] ={80000, 15000, -80000 }; //fine
a work around (I think) is to explicitly put an L in place to denote a
long - but why that would work, who knows?
const signed long tzerocal_A[] ={80000, 15000, -60000L }; //fine
The warning is specifically:
[warning] unsigned operand of unary -
Can anyone explain why this is happening. If -60000 were beyond the
valid range of a signed long, then surely -70000 or -80000 would
generate a warning too.
Thx. Ross.
differences between the versions is slightly different constants that
are specific to various embedded devices that are getting loaded.
Suddenly I notice a certain value generates a warning. Here's the
low-down:
The specific instance of the "-6" in this phrase generates a warning:
const signed long tzerocal_A[] ={80000, 15000, -60000 }; //bad
with some experimenting, -50000, and -40000 are also not liked
All these other versions will compile fine
const signed long tzerocal_A[] ={80000, 15000, -70000 }; //fine
const signed long tzerocal_A[] ={80000, 15000, -80000 }; //fine
a work around (I think) is to explicitly put an L in place to denote a
long - but why that would work, who knows?
const signed long tzerocal_A[] ={80000, 15000, -60000L }; //fine
The warning is specifically:
[warning] unsigned operand of unary -
Can anyone explain why this is happening. If -60000 were beyond the
valid range of a signed long, then surely -70000 or -80000 would
generate a warning too.
Thx. Ross.