C
CBFalconer
Keith said:.... snip ...
Say you're a compiler vendor, depending on customers giving you
money for your product. Your customers have been writing (bad,
non-portable) code for 32-bit systems that assumes long is exactly
32 bits. You want to start selling a version of your compiler for
64-bit systems. If you make long 32 bits, your customers will be
able to recompile their code, and it will still work. If you make
long 64 bits, your customers will have to go back and change their
code (and the modified code will probably be just as non-portable
as the original, just in different ways). Or, more likely, they'll
start buying compilers from your competitor who's still providing
32-bit longs.
If you choose to do the "right thing" and make long 64 bits, I'll
admire your principles, but I doubt that it will turn out well for
your bottom line. My personal inclination would be to provide 64-bit
long; that's probably one of the many reasons I'm not in marketing.
Yes, it's a real problem, and I'd love to see a real solution, but I
don't think it's the vendors' fault.
The problem originated long before C89. The smart thing would have
been to define a system value for INT_MAX, and insist that all
other quasi-int_MAXs be smaller and user set. This was done in
Pascal.
So my advice is to face the standard, as written.