Liste des Groupes | Revenir à cl c |
On 5/13/25 20:51, Keith Thompson wrote:That's a tautology - the C standard guarantees that two compatible types will work together in situations where the C standard requires that the types are compatible.James Kuyper <jameskuyper@alumni.caltech.edu> writes:...On 5/13/25 05:40, David Brown wrote:I was trying to match the wording of the text I was responding to. What>Yes. Basically, most C programmers are not particularly aware of the>
technical definitions of some of the terms in C standards where they
differ from common usage. The word "compatible" in English means that
the things in question can work together or fit together.
That's pretty much what it means in C. Two C types are compatible in C
if the C standard *guarantees* that they can work together - that you
can use the types interchangeably. The tricky part is the definition of
which pairs of types the C standard makes those guarantees for.
The key point is that the undefined behavior of code which treats
incompatible types as if they were compatible could also be that they
work together, too, depending upon the implementation.
I suggest that the phrase "work together" is too vague.
I meant can be made far more precise: the C standard guarantees that two
compatible types will work together, in the sense that every case where
the C standard mandates that two types must be compatible in order for
something to work, it will work for them.
Les messages affichés proviennent d'usenet.