Public bug reported:

Binary package hint: gcc-4.2

This is bizarre... gcc-4.2.3 for Hardy on ia32 compiles the code below
into a program that prints 1.  The correct answer is 0, and this is what
all other compilers (including gcc-4.1 and gcc-3.4 on Hardy/ia32)
return.

Furthermore, FSF gcc-4.2.3 also gives the correct answer!

Probably someone should look into this as comparison errors like this
could easily have security implications.

#include <stdio.h>

int func_1 (void)
{
  signed char l_11 = 1;
  unsigned char l_12 = -1;
  return (l_11 > l_12);
}

int main (void)
{
  printf ("%d\n", func_1());
  return 0;
}

** Affects: gcc-4.2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
gcc-4.2.3 on Hardy/ia32 miscompiles simple code
https://bugs.launchpad.net/bugs/256797
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to