8 bytes into 2 bytes fits ?
David C Binderman
dcb@pncl.co.uk
Sun Sep 6 08:32:00 GMT 1998
At 10:31 PM 9/2/98 -0300, you wrote:
>David C Binderman <dcb@pncl.co.uk> writes:
>
>> surely pointers can only be cast to types big enough to hold them.
>
>Casting a pointer (but not a pointer to member) to any integral type
>has always been allowed.
Not in my experience of C++.
>It is even possible that
>there isn't any integral type large enough to hold a pointer.
>However, even in this case, the conversion (a reinterpret_cast) is
>allowed.
I don't really agree with what you say, but even if I
did, I think any C++ compiler that permits lossage like this _without_
at least a warning (I'd make it an error) is asking for trouble.
I'm happy to leave as a quality of implementation issue.
Regards
David C Binderman MSc BSc +44 1293 534847 dcb@pncl.co.uk
More information about the Gcc-bugs
mailing list