[Ilugc] Re: Regarding gcc compiler in Linux

  • From: vijairaj_sr@xxxxxxxxxxxxxx (Vijairaj R)
  • Date: Tue Mar 1 20:18:14 2005

Sangharsha p g wrote:

   unsigned int a=0xffffffff;
   unsigned int b=a<<32;

The expected value of b should be 0 but it is displaying something else.

gcc is smart. The value of b is undefined if the right operand 
of shift is greater than or equal to the number of bits of the 
promoted left operand.

-- 
Regards,
R Vijairaj

Jai Jawan! Jai Kissan! Jai FSFn!

Other related posts: