I'm making a large project involving Box2D, and right now i'm going through and dealing with the warnings it's been giving me.
It's not a big deal, but I would like to understand.
Warning: dereferencing type-punned pointer will break strict-aliasing rules.
In "b2Math.h"
I looked this warning up, but I didn't quite understand what is going on. I also saw it in another post, but also didn't understand :/
Can someone tell me why the error is occuring and what it's about. Also can I fix it.
It's not a big deal, but I would like to understand.
Warning: dereferencing type-punned pointer will break strict-aliasing rules.
In "b2Math.h"
Code: Select all
inline bool b2IsValid(float32 x)
{
int32 ix = *reinterpret_cast<int32*>(&x);//this line
return (ix & 0x7f800000) != 0x7f800000;
}I looked this warning up, but I didn't quite understand what is going on. I also saw it in another post, but also didn't understand :/
Can someone tell me why the error is occuring and what it's about. Also can I fix it.