Why strict aliasing is required in C ?
Consider below C program.
If we call as “func()”it will return constant 1. But it is also possible to call the function as “func((double *)&a)” which was supposed to return 1 but returning something else. The code was made to return constant 1 only! That’s a big problem but STRICT ALIASING fixes it.
Use restrict qualifier keyword. It means you promise the compiler that something is not aliased with the pointer restrict keyword. If you break your promise you will only suffer. Please refer restrict keyword in C for details.