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: Char shifts promoted to int. Why?


On 18 December 2006 19:31, Robert Dewar wrote:

> Chris Lattner wrote:
> 
>> Thus, the transformation is safe in this specific case on i386.
>> However, shifting a 32-bit value left by 33 bits would not be safe.
> 
> That's the case where the transformation IS safe, since shifting a
> 32-bit value left by 33 bits gives an undefined result as I understand
> things.

  Only a compiler developer could say "It's safe because it's undefined so it
doesn't matter what it does"! :)

  I'm fairly sure most /users/ would call undefined behaviour dangerous...


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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