How to deal with the prompt “dereferencing type punned pointer will break strict aliasing rules” when compiling C?

It’s about 35814; it’s about static writing and final writing! >>

1. For example:

char my_array[10];

*(int *)my_array = 0xaabbccdd;

2. Amendment is the most serious problem:

char my_array[10];

int tmp =0xaabbccdd;

memcpy(my_array, & tmp, sizeof(tmp));

Similar Posts: