I used a 'bool' (then a 'boolean') to represent a boolean quantity. Isn't that the point of having a boolean type?
If the compiler's code absolutely depends on a variable having certain values and no others, the compiler should take steps to ensure that the variable contains a legal value. Instead, it prevented me initializing the variable to a known condition.
That's a common circumstance--variables aren't initialized to known conditions when power's applied.
What's the value in having a 'boolean' if you have to ultimately use bizarre, unsigned, faked, phony types to ultimately represent it with a byte anyhow?
No, the compiler *is* at fault. It optimized out the operation
w = (U.dat.flg ? true : false;)
substituting: U.dat.flg ==> w.
1 2 3 w = (U.dat.flg) ? (true) : (false);To do that is to assume expression #1 (U.dat.flg != 0) is equivalent to, has the same range of values as, and is interchangeable with expressions of type 'boolean' #2 & #3.
That's wrong.
Cheers, James Arthur