S
spibou
In page 81 of N1124 in footnote 87 we read:
If the value of the expression is represented
with greater precision or range than required
by the type named by the cast (6.3.1.8), then
the cast specifies a conversion even if the type
of the expression is the same as the named type.
Can someone give me an example of what this means ?
Otherwise the relevant section hardly says anything about
the semantics of cast. Assume for example that on some
machine unsigned int is 32 bits and unsigned char is 8
bits. If i is unsigned int what is the value of
(unsigned char) i ? Is it the same as 255 & i but of type
unsigned char as opposed to unsigned int ?
Spiros Bousbouras
If the value of the expression is represented
with greater precision or range than required
by the type named by the cast (6.3.1.8), then
the cast specifies a conversion even if the type
of the expression is the same as the named type.
Can someone give me an example of what this means ?
Otherwise the relevant section hardly says anything about
the semantics of cast. Assume for example that on some
machine unsigned int is 32 bits and unsigned char is 8
bits. If i is unsigned int what is the value of
(unsigned char) i ? Is it the same as 255 & i but of type
unsigned char as opposed to unsigned int ?
Spiros Bousbouras