top | item 11108476

(no title)

asgfoi | 10 years ago

I was also under the impression that the One True Way to type pun was to cast to char, which is allowed to alias, and then cast again to the type you actually want.*

That clearly doesn't work, but I can see from a naive perspective why some think that. It feels like a nice hack, but a cast to char* doesn't "remove" the original type.

To be clear: char* can alias any type, but only char* can alias char*.

discuss

order

No comments yet.