Hacker News new | past | comments | ask | show | jobs | submit login
Ten Rules for Writing Cross Platform 'C' Code (2008) (ski-epic.com)
3 points by nazri1 on July 17, 2018 | hide | past | favorite | 2 comments



Rule 4 regarding unsigned long is a horrible example as Windows keeps them as 32 bits on 32/64 bit compiles while UNIXes vary between 32 and 64 bits depending on compile mode making unsigned long a disaster of portability across platforms and bitnesses.

Stopped reading at that point as this article doesn’t deal with EBCDIC platform portability either... so overlooks the entire IBM main and minicomputer/OS400 market as well. And I say this as one who writes code on all of the above that does Unicode internally but one still has to interface with the OS.

Anyway. There is a LOT more to portability than what is written here.


In all fairness, the author did specifically say the target platforms for the article are Windows, OSX and Linux.

Agreed that portability beyond these platforms is a different story altogether.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: