Boost logo

Boost :

Subject: Re: [boost] [PATCH] [exception] Replace C cast with reinterpret_cast for Metrowerks C++
From: Joshua Juran (jjuran_at_[hidden])
Date: 2011-03-05 05:55:15


On Mar 5, 2011, at 2:07 AM, Christopher Jefferson wrote:

> On 5 Mar 2011, at 09:48, Joshua Juran wrote:
>
>> Metrowerks C++ 2.4.1 thinks the type of (T*)0 is T, rather than
>> T*. But reinterpret_cast works fine.
>
> That is an incredibly strange bug.

Agreed.

> This also introduced a bug. (T*)0 is the expected way to get a null
> pointer of type T*. A reinterpret_cast is incorrect (although in
> practice likely to work on most machines / compiles)
>
> Does static_cast work? That would be fine instead of the C-style cast.

Yes, thanks for the correction. I'll resend the patch.

Josh


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk