Specifically I am doing this
Word32 x = 18653184;
Word32 y;
Word16 shift = 269;
y = x >> shift;
I’d expect the result of this logical shift to be 0, but I am instead getting 2277. How does C define this type of operation?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it is undefined behavior, according to section 6.5.7 paragraph 3