> -----Original Message-----
> From: Martin Sebor [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 23, 2008 11:37 AM
> To: [email protected]
> Subject: Re: svn commit: r659253 - in /stdcxx/branches/4.2.x: 
> examples/manual/ src/ tests/algorithms/ tests/containers/ 
> tests/localization/ tests/numerics/ tests/regress/ tests/src/ 
> tests/strings/ util/
> 
...
> 
> FYI: The cast above changes the semantics of the expression
> by slicing the high 32-bits of which (when it's 64 bits wide)
> before shifting the result right, potentially causing it to
> lose its high order bits. I don't think the code is really
> unsafe since which is 32 bits wide in ILP32 but a more robust
> fix (should the type of which change to 64 bits in the future)
> would be to cast the result of the shift expression.

Oh so instead of casting just which, cast the result of the whole
expression?  I'll add that to my TODO list.

Brad.

Reply via email to