Re: Is it a bug when use “<<”if the operator is out of the size "0~63"

2012-02-24 Thread Jonathan Wakely
This question is not appropriate for this mailing list, questions about using GCC should be sent to the gcc-h...@gcc.gnu.org list, please take any follow up there, thanks. On 24 February 2012 08:34, Yang Yueming wrote: > > The result of xyz should be "0",but it is "2468acf123579bc" ,same as  xyz =

Re: Is it a bug when use “<<”if the operator is out of the size "0~63"

2012-02-24 Thread Miles Bader
Yang Yueming writes: > long long abc = 0x01234567891abcde; > long long xyz; ... > xyz = abc << 65; ... > The result of xyz should be "0",but it is "2468acf123579bc" ,same as > xyz = abc << 1,Why? Because the shift operators in C have an undefined result when the shift-count is larger than

Is it a bug when use “<<”if the operator is out of the size "0~63"

2012-02-24 Thread Yang Yueming
Case: #include #include long long abc = 0x01234567891abcde; long long xyz; int main () { xyz = abc << 65; printf("%llx\n", xyz); return 0; } The result of xyz should be "0",but it is "2468acf123579bc" ,same as xyz = abc << 1,Why? So as for "i