Assignment Ops and Side Effects
Tim McDaniel
mcdaniel at adi.com
Thu Apr 11 02:58:28 AEST 1991
In article <18393 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com
(Christopher R Volpe) quotes:
>
> 3.2.1.1: A char ... may be used in an expression wherever an int or
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> unsigned int may be used. If an int can represent all values of the
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> original type, the value is converted to an int.; otherwise, it is
> converted to an unsigned int. These are called the integral
> promotions.
>
> This appears to say that this conversion occurs in any expression
> context, subject to explicit exceptions made elsewhere.
See the first paragraph of section 3.2, "Conversions":
Several operators convert operand values from one type to another
automatically. This section specifies the result required from
such an *implicit conversion* .... The list in 3.2.1.5 summarizes
the conversions performed by most ordinary operators; it is
supplemented as required by the discussion of each operator in 3.3.
Section 3.2.1.5, "Usual Arithmetic Conversions" (ditto):
Many binary operators that expect operands of arithmetic type cause
conversions and yield result types in a similar way....
--
"Of course he has a knife. We all have knives. It's 1183, and we're
all barbarians."
Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA
Internet: mcdaniel at adi.com UUCP: {uunet,sharkey}!amara!mcdaniel
More information about the Comp.lang.c
mailing list