Trying to convert a pointer to void to a type with alignment requirement invokes undefined behaviour, according to C++11 draft (n4296)
From 5.2.9 Static cast §13 : A prvalue of type “pointer to cv1 void” can be converted to a prvalue of type “pointer to cv2 T,” where T is
an object type and cv2 is the same cv-qualification as, or greater cv-qualification than, cv1... If the original pointer value represents
the address A of a byte in memory and A satisfies the alignment requirement of T, then the resulting pointer
value represents the same address as the original pointer value, that is, A. The result of any other such pointer conversion is unspecified (emphasize mine)
I know you are using an explicit cast (or C-style cast), but 5.4 Explicit cast says: The conversions performed by a const_cast (5.2.11), a static_cast (5.2.9), a static_cast followed by a const_cast, a reinterpret_cast (5.2.10), or a reinterpret_cast followed by a const_cast,
can be performed using the cast notation of explicit type conversion. The same semantic restrictions and behaviors apply...
So in your case, the explicit cast is the same of static_cast<int const *>(p)
.
And some architectures, notably ARM architecture are know to trap when you try to access unaligned int pointers as said in that other SO answer