It was thus said that the Great Mouse once stated:
-spc (Wish
the C standard committee had the balls to say "2's
complement all the way, and a physical bit pattern of all 0s is a
NULL pointer" ... )
As far as I'm concerned, this is different only in degree from `Wish
the C standard committee had the balls to say "Everything is x86".'.
First off, can you supply a list of architectures that are NOT 2's
complement integer math that are still made and in active use today? As far
as I can tell, there was only one signed-magnitude architecture ever
commercially available (and that in the early 60s) and only a few 1's
complement architectures from the 60s (possibly up to the early 70s) that
*might* still be in active use.
Second, are there any architectures still commercially available and used
today where an all-zero bit pattern for an address *cannot* be used as NULL?
Because it comes across as strange where:
char *p = (char *)0;
is legal (that is, p will be assigned the NULL address for that platform
which may not be all-zero bits) whereas:
char *p;
memset(&p,0,sizeof(p));
isn't (p is not guarenteed to be a proper NULL pointer) [1].
My wish covers yes, the x86, but also covers the 68k, MIPS, SPARC,
PowerPC and ARM. Are there any others I missed?
-spc (Also, the only portable exit codes are EXIT_SUCCESS and EXIT_FAILRE
[2][3])
[1] I know *why* this happens, but try to explain this to someone who
hasn't had *any* exposure to a non-byte, non-2's complement,
non-8-32-64bit system.
[2] From my understanding, it's DEC that mandated these instead of 0 and
1, because VMS used a different interpretation of exit codes than
everybody else ...
[3] I only bring this up because you seem to be assuming my position is
"all the world's on x86" when it's not (the world is "2's
complement
byte oriented machines"). And because of this, I checked some of
your C code and I noticed you used 0 and 1 as exit codes, which,
pedantically speaking, isn't portable.
Yes, I'll admit this might be a low blow here ...