21 May
2010
21 May
'10
8:32 a.m.
On 21/05/2010 9:37, Neil Groves wrote:
These reinterpret_cast operations violate the standard aliasing rules AFAICT. Indeed while most compilers work happily with this arrangement. I have reproduced defects with GCC 4.4 when optimizations are enabled. Additionally if one enables the strict aliasing warnings these lines are indicated as being incorrect.
What if we use static_cast? Does this solve any problem? I don't know much about aliasing rules so can you shed some light on this? Best, Ion