Subject: Re: [boost] [optional] Strict Aliasing Warnings on Trunk
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-12-18 03:11:23
On Thu, Dec 17, 2009 at 11:17 PM, Dean Michael Berris
>>>> To someone who doesn't know the
>>>> semantics of reinterpret_cast, perhaps the warning has some value, but
>>>> for the rest of us what it really says is "Warning! You have used
>>> Sure, but isn't reinterpret_cast considered bad because of the fact
>>> that there is no standard implementation of it?
>> I'm not sure what you mean. There is a standard implementation of
> Really? I thought this was implementation-defined?
Sure, but it is specified that if you reinterpret_cast from T1* to
T2*, then reinterpret_cast the resulting T2* back to T1*, you'll get
the original value (as long as T2 doesn't have stricter alignment
Reinterpret_cast is tricky but it is part of the language and it's
lame for the compiler to warn when it is used.
Reverge Studios, Inc.