question about shift operator

Randy D. Miller randy at gtx.com
Wed Nov 2 02:06:08 AEST 1988


I've seen conflicting information about the shift operator in cases
where operand2 is exactly equal to the number of bits in the object.
E.g., with a 32 bit int, what must the following do?

     int n;
     n <<= 32;

K&R 1st ed. seems to indicate the operation is undefined, but does
the proposed standard change this?  

-- 
Randy D. Miller             (602) 870-1696
GTX Corp., 8836 N. 23rd Ave., Phoenix, AZ 85021
{cbosgd,decvax,hplabs,amdahl,nsc}!sun!sunburn!gtx!randy



More information about the Comp.lang.c mailing list