Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • How do other people ensure interoperability for various OSs? Do they have accounts for different machines or is it programmer's experience that makes the thing work on most platforms?

    A bit of both. There's no substitute for testing on different machines (and with different compilers), but you'll have a lot less problems if the first place once you become experienced in what is and isn't portable

    Part of the problem with portability is that the most common platform (x86) is one of the most forgiving (little or no alignment contraint on pointers, no structure padding), and the most common compiler (gcc) is similarly lax. Bondage and discipline is good for you, but sadly they are not even the implicit default.

    For example, your module is also failing its tests on PPC linux, so I'd suspect that it's an endian-ness bug somewhere (your code, or the included library), as both sparc and PPC are big endian. (ie I'm guessing that your code and the library is mostly tested on x86). If it had passed on sparc, but failed on PPC (and ARM; usually little endian) then my guess would be that it woudl be a plain char issue (char is unsigned on PPC and ARM, signed just about everywhere else.)

    The you start to get to more esoteric stuff, such as what happens when you ask for a logical shift larger than the integer (undefined behaviour in C, this might actually be your probkem here), or signed integer arithmetic overflows (undefined behaviour, but it turns out that it will do what you expect, if you think it should just do 2s complement, on most platforms except for 64 bit Irix and UTS), whether sizeof(long) isn't sizeof(int), whether a pointer is larger than int, whether sizeof(short) isn't 2 (on Crays it is 8), how bitfield ordering works, is '\n' actually 10, is 'A' > '1', etc