Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Casting smaller doesn't hurt if the numbers are small and you're little endian - because the ptr will still point at the meat of the scalar (instead of the high bytes with zeros in them as it would if big-endian)


I'm not sure you understand big-endian casting—it's still value based, so you'll still get the least significant bits in the casted value.


The issue was, casting an untyped pointer which does NOT get the conversion you mention.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: