From MISRA-C:2012 the rule 19.1 is mandatory:
An object shall not be assigned or copied to an overlapping object
Example 1:
void fn ( void )
{
union
{
int16_t i;
int32_t j;
} a = { 0 }, b = { 1 };
a.j = a.i; /* Non-compliant /
a = b; / Compliant - exception 1 */
}
Example 2:
#include <string.h>
int16_t a[ 20 ];
void f ( void )
{
memcpy ( &a[ 5 ], &a[ 4 ], 2u * sizeof ( a[ 0 ] ) ); /* Non-compliant */
}