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]

A long long int bug


Hi,

I got this on linux/x86.

# gcc foo.c
foo.c: In function `main':
foo.c:7: warning: left shift count >= width of type
# a.out
zsh: 19368 abort      ./a.out


-- 
H.J. Lu (hjl@gnu.org)
---foo.c-
main ()
{
  unsigned long long int x;

  if (sizeof (x) > sizeof (int))
  {
    x = 1UL << 33UL;
    if (x == 0)
      abort ();
  }

  return 0;
}


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