Keith Thompson said:
I disagree.
Yes, we all know that "implicit cast" really means "implicit
conversion"; understanding what was meant is not the point.
The point is that the word "cast" has a very specific meaning,
and that meaning is specific to C, so questions of common English
are not quite as relevant as they might otherwise be.
If we loosely use the word "cast" to mean any conversion, implicit
or explicit, then what do we call the operator consisting of a
parenthesized type name?
We have two perfectly good words, "conversion" and "cast", with
related by quite distinct meanings. I don't want to lose that
useful distinction. I don't want to have to qualify every use of
either word with "explicit" or "implicit".
Even allowing use of the phrase "implicit cast", I don't think you
have to. Let me explain why.
The word "cast" in "implicit cast" doesn't just mean 'conversion'.
In fact C does implicit conversions in lots of different places,
in the sense that if a cast is an explicit conversion than a
conversion without using a cast is an implicit conversion. But
only some implicit conversions are meant by the phrase "implicit
cast". For example, if we have 'a + b', with variables 'a' and
'b' both shorts, the values are converted to type int before the
addition is done. This situation does do implicit conversion, but
does not fall under what was meant by "implicit cast" in the
original posting. In particular, an "implicit cast" is meant to
cover those cases where an inter-type (or inter-type-category?)
conversion is allowed in assignment-like contexts. This subset
is an important subset to identify, because it corresponds to
situations where "something surprising" happens. (Obviously
how "surprising" it is depends on the person, but I think you
can see what I mean.)
Other languages sometimes use the word "coercion" in connection
with this sort of implicitly-supplied conversion. Unfortunately
other languages use "coercion" to mean something very different,
so it isn't a good term to use in general. The problem is, C
has no term (in the sense that the Standard doesn't employ any
sort of term) to describe this situation, viz., where one type
is assignable to another but not (always) interoperable otherwise.
If we have 'void *pv;' and 'char *pc;', then 'pc = pv;' is allowed,
but 'pc - pv' is not allowed, as one example. Because there is
no Standard-sanctioned term for this kind of important case,
people pick a phrasing that they think expresses their meaning.
Under the circumstances, using the phrase "implicit cast" is
natural, and IMO better than many of the alternatives.
This isn't to imply that anyone who uses the phrase "implicit
cast" is stupid or evil. It's a common mistake, and a perfectly
understandable one. But it is, in my opinion, a mistake, and one
worth correcting.
I wouldn't call using "implicit cast" as an English phrase a
mistake, because I don't think it's 'wrong'. Of course it's
not technically accurate use of jargon. It isn't meant to
be. If there is confusion on that point, that confusion
might be worth pointing out, ie, if someone thinks 'implicit
cast' has a well-defined meaning under C Standard terminology,
that misunderstanding may deserve some comment. But if used
as a phrase in ordinary English, I don't think it should be
called "wrong", even if does make some of the more literal-minded
readers grit their teeth.
So here is my challenge to c.l.c readers (or at least those
following this thread): Don't like the phrase "implicit cast"?
Suggest a better one. Remember, we're looking for a term that
applies not to all cases where a conversion is implied by the
semantics, but only to cases such as assignment-like contexts
(and if you want you can say exactly which contexts fall into that
category). I'm happy to recommend another term be used, if
someone can come up with something that's clearly better.