Assignment Ops and Side Effects

Tim McDaniel mcdaniel at adi.com
Tue Apr 9 05:39:46 AEST 1991


In article <18324 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com
(Christopher R Volpe) writes:

   Could someone explain to me why sizeof(c=1) is 1 and not
   (typically) 4?? The result of the assignment operator is not an
   l-value, and thus undergoes the integral promotions.

Not true.  The default arithmetic conversions are never applied to the
operand of sizeof, whether lvalue or not; see section 3.3.3.4.  (It
doesn't mention any promotions there.  It's always careful to mention
promotions where they occur, as under "+".)

--
   "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