Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: how cast works? Date: Fri, 09 Aug 2024 17:27:19 -0700 Organization: None to speak of Lines: 38 Message-ID: <877ccp5ijc.fsf@nosuchdomain.example.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> <87frrd5jw7.fsf@nosuchdomain.example.com> <20240809170514.433@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 10 Aug 2024 02:27:19 +0200 (CEST) Injection-Info: dont-email.me; posting-host="0c353c12c58454f0df934f7da485585f"; logging-data="269016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19k6V6HFH6YKrsP0CO8EqlW" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:5Go8usoSzi6M9MUcOL/l1CYZE+s= sha1:sqZ4i8IzQjvaz2AbbRBWxSyN3uo= Xref: csiph.com comp.lang.c:387465 Kaz Kylheku <643-408-1753@kylheku.com> writes: > On 2024-08-09, Keith Thompson wrote: >> 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. >> >> *Looks around* sorry, are we still in comp.lang.c? >> >> "Cast" has a number of meanings in contexts outside C, applicable to >> dice, eyes, fishing lines, ballots, magic spells, actors, liquid metal, >> and broken limbs, among other things. In C, it means what the standard >> says it means, even if some people misuse it to refer to implicit >> conversions. >> >>> In C though, the nuance is something like "conversion that is mediated >>> by the presence of the cast notation", where "mediated" includes the >>> possibility that the cast notation has no effect at all >>> (e.g. 2 + (int) 3). >> >> I hadn't noticed before that the standard does have a formal definition >> of the term "cast", as well as "explicit conversion" and "implicit >> conversion". > > Based on surveying all you quoted, I basically nailed it above. I honestly don't know what you mean by that. Feel free to explain if you wish. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */