question about shift operator

Larry Jones scjones at sdrc.UUCP
Thu Nov 3 09:06:36 AEST 1988


In article <786 at gtx.com>, randy at gtx.com (Randy D. Miller) writes:
> I've seen conflicting information about the shift operator in cases
> where operand2 is exactly equal to the number of bits in the object.
> K&R 1st ed. seems to indicate the operation is undefined, but does
> the proposed standard change this?  

Nope, the draft says "If the value of the right operand is
negative or is greater than or equal to the width in bits of the
promoted left operand, the behavior is undefined."

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at sdrc.uucp
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"Save the Quayles" - Mark Russell



More information about the Comp.lang.c mailing list