Hacker News new | ask | show | jobs
by vrfcodf 3729 days ago
That is not correct. The type used to write to the memory is int, not void or char. If the object, whose address is passed to the function is not compatible with int, the behavior is undefined.

You should read about strict aliasing, you will be surprised.

1 comments

You're right, I misread and misinterpreted that! Thanks.

Somehow I wasn't thinking and didn't realize that `t` aliases whatever was passed as `p`, and dereferencing a non int or char pointer would be undefined there.