Do you believe that the committee *deliberately* left the
compatibility or incompatibility of int and long unspecified,
*and* failed to require implementations to document their choice?
I don't know - their intent has often significantly differed from the
words they wrote, but I think it's a definite possibility that they
intended to leave it unspecified. For convenience, I'd like to
distinguish this concept of compatibility from my own concept. I'll call
this concept ISO compatibility, or I-compatibility for short. If two
types are specified by the standard to be compatible, then they are
I-compatible, otherwise they are I-incompatible.
Do you think they meant to allow implementations to make int and
long compatible even if they're of different sizes? If so, do you
think it made sense to do so?
You keep bringing up compatibility of int and long of different sizes. I
can't imagine any way to implement them so they're compatible, so the
issue shouldn't come up. However, it's been proven time and again that
my imagination is inadequate, so I try to cover all possibilities. If,
by some magic, they actually figure out how to make a 32-bit int
compatible with a 64-bit long, then I don't see anything wrong with
handling them as compatible types as far as the standard is concerned.
The case I'm much more concerned about is an int and a long that are
both handled identically by a given implementation. For example, they
could both be 32-bit big-endian types with no padding bits and no trap
representations. If you think that such an implementation is still
required to diagnose them as incompatible, assume that it does so - but
after issuing the diagnostic, it then generates an executable that
behaves exactly the way it would have if 'int' and 'long' were merely
two synonyms for the same type.
Would it be reasonable to describe such an implementation by saying that
'int' and 'long' were incompatible?
That's basically what "compatible" means to me - for the sake of
discussion, I'll call my concept Kuyper-compatibility, or
K-compatibility for short. If the actual behavior (not including the
generated diagnostics) for two different types is the same as it would
have been if they had been two synonyms for the same type, then they are
K-compatible types; otherwise, they are K-incompatible types.
After a long frustrating thread on some related topic a couple of years
ago, I reached the conclusion that when the standard says two types are
compatible, what it means is only that it guarantees that the two types
are K-compatible. When it leaves the question open, the two types might
be K-compatible, or they might be K-incompatible. On that basis, I
concluded that the standard meant "K-compatible" when it said "compatible".
What this means, therefore, is that I-compatible is essentially
equivalent to "guaranteed by the standard to be K-compatible", while
I-incompatible means "not guaranteed by the standard to be
K-compatible". I consider it plausible that the committee may have
intended "compatible" to mean I-compatible rather than K-compatible.
However, that has not been my understanding, and I'm not yet convinced
of it. Any authoritative statement on that matter from someone like
Larry Jones would convince me. I don't see any problems (other than
footnote 35) associated with the possibility that the committee meant
K-compatible when they used the term "compatible".