Path: csiph.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Tue, 11 Apr 2023 05:31:04 -0700
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <86pm8a38jb.fsf@linuxsc.com>
References: <87zg7n89zw.fsf@bsb.me.uk> <874jpv84uv.fsf@bsb.me.uk> <20230407042121.909@kylheku.com> <86r0st3zj0.fsf@linuxsc.com> <871qkshmhv.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="b8523dcffbf3f55a5b42bbad23f83ee0"; logging-data="2757325"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CTSPYXAf9JKnM0RGRDgOf3vpEwUTAOkc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:0m/fL+nTYETPDkmEh03iy5wU2F8= sha1:ve/lBUZnH7i4XWfyJNmcT/AKKqs=
Xref: csiph.com comp.lang.c:169972
James Kuyper writes:
> "Several operators convert operand values from one type to another
> automatically. This subclause specifies the result required from
> such an implicit conversion, as well as those that result from a
> cast operation (an explicit conversion)." (6.3p1)
>
> The terms "implicit conversion" and "explicit conversion" are both
> italicized in the actual standard, which is an ISO convention
> indicating that the sentence in which they occur is the official
> definition of what those terms mean.
>
> Implicit conversions occur in the following contexts:
>
> The integer promotions (6.3.1.1p2).
> The usual arithmetic conversions (6.3.1.8p1).
>
> An lvalue of array type is implicitly converted into a pointer to
> the first element of that array in many contexts (6.3.2p3). This is
> done as a convenience, but has led many people to confuse arrays
> with pointers.
>
> A function designator is implicitly converted into a pointer to the
> designated function in many contexts (6.3.2p4).
>
> The default argument promotions (6.5.2.2p6).
>
> Simple assignment (6.5.16.1p2).
>
> As-if by assignment:
> Arguments of function declared with a prototype. (6.5.2.2p7, 6.9.1p10)
> Return expression. (6.8.6.4p3)
Good list.
There is one other case of same rule as assignment, which is
scalar initializer values, either in declarations or in
compound literals.