16-02-2010, 01:47 PM
After some thinking about the issue, I came to the conclusion that the
underlying type of a &&, || or ! is determined in the same way as for
arithmetic operations, and the previous example needs to be clarified
a little bit:
boolU8 = boolU8X && boolU8Y;
is fully compliant, whereas
boolU8 = boolU8X && boolS8Y;
is not compliant, one of the operands needs to be casted, e.g.:
boolU8 = boolU8X && (uint8)boolS8Y;
However, the problem with relational operators remains:
boolU8 = a > b;
What is the underlying type of the result of a >, >=,
underlying type of a &&, || or ! is determined in the same way as for
arithmetic operations, and the previous example needs to be clarified
a little bit:
boolU8 = boolU8X && boolU8Y;
is fully compliant, whereas
boolU8 = boolU8X && boolS8Y;
is not compliant, one of the operands needs to be casted, e.g.:
boolU8 = boolU8X && (uint8)boolS8Y;
However, the problem with relational operators remains:
boolU8 = a > b;
What is the underlying type of the result of a >, >=,
<r>Gunter Blache<br/>
<br/>
ETAS GmbH<br/>
PSW<br/>
Global Operations<br/>
Borsigstraße 14<br/>
70469 Stuttgart<br/>
Phone +49 711 89661-159<br/>
Fax +49 711 89661-330<br/>
<br/>
<URL url="http://www.etasgroup.com">http://www.etasgroup.com</URL></r>
<br/>
ETAS GmbH<br/>
PSW<br/>
Global Operations<br/>
Borsigstraße 14<br/>
70469 Stuttgart<br/>
Phone +49 711 89661-159<br/>
Fax +49 711 89661-330<br/>
<br/>
<URL url="http://www.etasgroup.com">http://www.etasgroup.com</URL></r>