Cross platform... You wish Write a program that will produce differing behaviors on as many different platforms as you can. Each differing platform awards one point (including an initial platform, meaning you can't score less than 1*). Mechanisms intended for determining the target/executing platform (e.g. through platform compilation statements or APIs like .NET's Environment.OSVersion.Platform) must not be used. The answer with the highest score wins (where upvotes are the tiebreakers).

For example, consider the following program in the Blub language: print (1+2). If this program were to print 3 on every platform it is compiled and run on, its score would be 1. However, if, for any reason, it were to print 4 on PDP-11s, its score would be 2. Etc. But the following C snippet, for example, is an invalid entry: #ifdef WIN32 ... #endif.



Definitions/details:


Distinct platform: the combination of a) the hardware architecture b) the OS and its MAJOR version number (e.g. 1.0.0 and 1.1.0 are considered the same OS)
Differing behavior: two behaviors are the same iff they produce similar side-effects (e.g. creating the same file with the same contents), or if the side-effect are errors of the same kind. For example, if a program segfaults on two distinct platforms, but the segfault message is different on these platforms, this is still considered the same behavior; while a program producing a zero-division error on one platform and a stack overflow (see what I did there? ;) error on another is producing different behavior.
All undefined behaviors are considered equivalent.
Program must be invoked in an equivalent manner on all platforms (however; this does mean you can pass command-line parameters if you so desire)




* Well, I guess you'd score zero if your program ran on zero platforms. But um... Yeah nevermind.
C
I will take a stab at it with a textbook-like example:
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main()
{
    char a[] = {1,2,3,4,5,6,7,8};
    if (sizeof(&amp;a) &gt; sizeof(int)) {
        printf(&quot;foo %d %d\n&quot;, *(int *)a, *(long *)a);
    } else {
        printf(&quot;bar %d %d\n&quot;, *(int *)a, *(long *)a);
    }
}

64-bit Platform prints: foo
32-bit Platform prints: bar
Little Endian Platforms: 67305985
Big Endian Platforms: 16909060
So there is at least 4 combinations.
On top of that, some very old platforms has int defined as 16-bits. And some platform has long defined as 64-bits. So the result will be different as well.
C has been quite platform specific, if you dig deep enough. It is not hard to come up with thousands of combinations (2^10+).