3 ms·
I worked on the Linux version of a large program and after some years of it I mostly concluded that it's hard to know in advance which things work everywhere an
by evmar 11y ago
I worked on the Linux version of a large program and after some years of it I mostly concluded that it's hard to know in advance which things work everywhere and which won't, unless you ensure your programmers are familiar with the quirks of all the platforms you intend to run on (which isn't really practical).
(I was working on the Windows -> Linux path, but for some cross-OS examples that aren't that I was surprised to learn that while toupper follows your locale on Linux, OS X uses the "C" locale by default. Or that shm_open has a tiny size limit on OS X.)
I think the best you can do is (1) write a lot of tests; (2) whenever you add an OS-specific snippet, use the same ifdef string so it's easy to grep for.