dereferencing type-punned pointer will break strict-aliasing rules

5 May
2011
5 May
'11
11:35 a.m.
Dear all, [Boost 1.46, GCC 4.5.1, MinGW32, WinXP SP3] I use a number of Boost libraries that I see emit the following warning in GCC under release build: "dereferencing type-punned pointer will break strict-aliasing rules" I have traced the code (of SmartPtr and Function specifically) and it's always with an operations like reinterpret_cast<T*>(...)->~T(). Now, I'm wondering how safe this reinterpret_cast is? How serious should I take this warning here? (I do already know how to turn it off or the strict aliasing check.) And, more than anything else: Is this warning suggesting an improvement in my own code? TIA, --Hossein
5149
Age (days ago)
5149
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hossein Haeri