Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: annex j

...

A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the referenced type, the behavior is undefined.

(See also undefined behavior 25  in Annex J of the C Standard.)

If the misaligned pointer is dereferenced, the program may terminate abnormally. On some architectures, the cast alone may cause a loss of information even if the value is not dereferenced if the types involved have differing alignment requirements.

...