It's actually worse than that. The test can give incorrect results even for the current machine. e.g.:
void foo(float * p) // assume p is misaligned
{
*p = 0; // first store
frob(0);
*p = 0; // second store
}
It is possible for the first store to succeed and the second to cause an alignment fault (or vice-versa).
It's actually worse than that. The test can give incorrect results even for the current machine. e.g.:
void foo(float * p) // assume p is misaligned
{
*p = 0; // first store
frob(0);
*p = 0; // second store
}
It is possible for the first store to succeed and the second to cause an alignment fault (or vice-versa).