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

I've tried to tackle this issue at https://github.com/alexchamberlain/byte-order.


You did this to prove Pike's argument, didn't you?

Whenever I see code that asks what the native byte order is, the odds are about a hundred to one the code is either wrong or misguided.

https://github.com/alexchamberlain/byte-order/commit/b804361...


Well caught!


Nice! I think I'll use this. I was going to suggest also including calls to platform-specific byte swapping functions for compilers other than GCC, but maybe it's better to wait until it's actually demonstrated to be a benefit.


I'll quite happily optimise it to work with other compilers... Anything bar x86 might be a problem though...




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

Search: