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.
- Namespace in C++ | Set 3 (Accessing, creating header, nesting and aliasing)
- Puzzle | Strict Pill Schedule
- Length of longest strict bitonic subsequence
- Number of decimal numbers of length k, that are strict monotone
- Powers of 2 to required sum
- HTML | required Attribute
- Minimum time required to rot all oranges
- Minimum Swaps required to group all 1's together
- Minimum Players required to win the game
- Minimum rotations required to get the same string
- Minimum boxes required to carry all gifts
- Minimum number of operations required to reduce N to 1
- Minimum number of palindromes required to express N as a sum | Set 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.