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:27:29 -0700 Organization: A noiseless patient Spider Lines: 17 Message-ID: <867ccmk2ku.fsf@linuxsc.com> References: <87ttfu94yv.fsf@nosuchdomain.example.com> <87bk228uzg.fsf@nosuchdomain.example.com> <20240809142622.467@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 12 Aug 2024 02:27:30 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f42e4005105099d89c60a754521770ce"; logging-data="3093877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9TCXIt9hs0fdcNQoa8G7YNOd01N4i+/E=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:jvnokxuKj59DbbdFDYnPiXnLsc0= sha1:gucrjDffOJXgh1ivTcJjQNXFg/M= Xref: csiph.com comp.lang.c:387490 Kaz Kylheku <643-408-1753@kylheku.com> writes: > In computer science, we refer to unsafe conversion as coercion. In most programming languages, "coercion" refers to any implicit conversion (perhaps requiring a change in type), regardless of whether the conversion is safe or is not. > THe cast notation is C's coercion operation. Absolutely not. "Coercion" usually means an implicitly caused conversion, following the term being introduced in Algol 68. A cast in C is exactly the opposite, always explicit. Disclaimer: the above comments based on cursory research to reinforce my memory of literature read years ago, and supported by Wikipedia.