Reading this very interesting thread I got the
malevolent idea to
implement a compliant C compiler which is as different from every
other as possible. Perhaps also for a fictional machine that also
differs in many ways from existing machines.
I've often thought it would be useful to have such a thing, a
"checkout" compiler which deliberately goes out of its way to break
pretty much every not-promised thing it can.
Efficiency would sufer, of course, but for these purposes that's a
minor matter.
I think statement such as "this program is
written to be portable" it
means portable in just one or a handfull of aspects.
Usually. It's _hard_ to do anything useful in a strictly conforming C
program. And even strict conformance is no guarantee; whichever
standard you pick, there will be compilers that predate it and/or
ignore various aspects of it. I once used a language for an 8-bit
microcontroller whose int was only 8 bits wide - obviously not,
strictly, C, though the compiler vendor called it C and it wasn't
_completely_ unreasonable of them; it was very very Cish.
E.g. "Portable regarding endianess"
"Has been compiled with GCC on two platforms"
The Jargon File has an entry for "Berkeley Quality Software", which it
says "usually has nonexistent, incomplete, or incorrect documentation,
has been tested on at least two examples, and core dumps when anyone
else attempts to use it". Far too much "portable" software appears to
fit this description....
But, yeah, portability is always only relative. Even your example
"portable regarding endianess" is only relative; does this putatively
portable code actually work in unusual cases such as PDP-endian, or
just the two common endiannesses?
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse at
rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B