kripken/emscripten — Issue #209: Negative int64 comparison fails
Author: crazyjul
Created: 2012-02-02 16:18:43+00:00
State: open

I ran this sample test :

#include
#include

int main()
{
long long i,j,k;

i = 0;
j = -1,
k = 1;

printf( "%s\n", i > j ? "Ok": "Fail" );
printf( "%s\n", k > i ? "Ok": "Fail" );
printf( "%s\n", k > j ? "Ok": "Fail" );
printf( "%s\n", i > std::numeric_limits::min() ? "Ok": "Fail" );
printf( "%s\n", i < std::numeric_limits::max() ? "Ok": "Fail" );
}

The ouput is

Fail
Ok
Fail
Fail
Ok

This prevent istream::operator>>(int&) from working.

I've searched some time but can't figured it out yet