Sujet : Re: how cast works?
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 12. Aug 2024, 12:21:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9cr7h$38lqf$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 12/08/2024 08:33, Tim Rentsch wrote:
Bart <bc@freeuk.com> writes:
On 09/08/2024 00:17, Keith Thompson wrote:
>
Bart <bc@freeuk.com> writes:
[...]
>
Take:
>
int a; double x;
>
x = (double)a;
>
The cast is implicit here but I've written it out to make it
clear.
[...]
Since C likes to use the term 'cast' for such conversions, [...]
The C standard uses the term 'cast' only for explicit conversions,
and never uses the term 'cast' for implicit conversions. You
should do the same.
I'm not the C standard.
It just seems to irk the pedantics here.
What bothers people is not you using the wrong terminology. What
bothers people is you being a self-centered jerk, and deliberately
using incorrect terminology just to annoy people.
Incidentally, the word "pedantic" is an adjective. The noun form
is "pedant". People who complain about you using terminology
incorrectly are not being pedants.
My bad.
They simply are offended by
your never-ending efforts to be a pest and an asshole.
Interesting, as people could say that about you as well.
Some people here like to drag every discussion, every topic, into the realm of the C Standard. And a few like to seize on the slightest misuse of a term which has a specific meaning in C standard, even though that has no practical bearing on the discussion
But what about terms that do not appear in the C Standard?
Since it doesn't use 'implicit cast', presumably I can give that any meaning I like, including meaning 'implicit type conversion'. 'cast' is shorter to write than 'conversion' or 'coercion', and adds variety to sentences.
I notice that no one picked on the casual use of terms I found in the N1570 standard, or just waved them aside:
* Using 'explicit cast' (which implies 'implicit cast') (6.5.4p3)
* Using 'type casts' (redundant 'type') (H.2.4P1)
* Using ' ... conversions (casts) ...' where, if 'conversions' can
include implicit ones, would imply implicit casts too (H.2.4p4/5)