This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


This question is not appropriate for this mailing list, questions
about using GCC should be sent to the gcc-help@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 = abc << 1,Why?

The C standard says it's undefined behaviour:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]