Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: how cast works?
Date: Sun, 11 Aug 2024 17:32:54 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <8634nak2bt.fsf@linuxsc.com>
References: <87ttfu94yv.fsf@nosuchdomain.example.com> <87bk228uzg.fsf@nosuchdomain.example.com> <20240809142622.467@kylheku.com> <87jzgp5php.fsf@nosuchdomain.example.com> <20240809152755.123@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Mon, 12 Aug 2024 02:32:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f42e4005105099d89c60a754521770ce"; logging-data="3093877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184zMGi5HzZeGFrhoyu36jMooQ7pBkAL6E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:AHqnKpZrYBT+FfBcKG7RdqAmvgI= sha1:F821/t4azEIlfomZJ+UzmuDYJuQ=
Xref: csiph.com comp.lang.c:387491
Kaz Kylheku <643-408-1753@kylheku.com> writes:
> On 2024-08-09, Keith Thompson wrote:
>
>> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>> [...]
>>
>>> It almost makes sense to speak of "implicit cast" (i.e. coercion) in C,
>>> because of what happens implicitly being so unsafe.
>>
>> I disagree, because that's not what "cast" means.
>
> "cast" means to (try to) project a value into another type.
In programming, "cast" means to force a value to be expressed
in a particular type, regardless of whether the output type
differs from the input type.