I think ((1 ? (int)1 : (unsigned int)2) > -1) results in 1 (true), but actually it is 0 (false) in Visual Studio 2017.
I think the value of (1 ? (int)1 : (unsigned int)2) should be (int)1, because 1 ? is true, and 1 > -1 would be true.
I don't know the reason why the final result of this expression is false.
When I try casting like ((int)(1 ? (int)1 : (unsigned int)2) > -1), it returns 1 (true).
signed int test = -1;
signed int si = 1;
unsigned int ui = 2;
printf("%d\n", ((1 ? si : ui) > test));
return 0;
I expect the output to be 1, but the actual output is 0.