I would suggest that the problem you are facing is the subtle, implicit progress that occurs in the statement ?:. The second and third operands are balanced with each other using ordinary arithmetic transformations. This is provided by C11 6.5.15:
, , , , , .
, , - , unsigned. , 2- 3- .
, :
#include <stdio.h>
int main (void)
{
int x;
if( (-1 ? (printf("Expression evaluates to -1\n"),-1) : 0xFFFFFFFF) < 0)
{
printf("-1 is < 0");
}
else
{
printf("-1 is >= 0");
}
}
:
Expression evaluates to -1
-1 is >= 0
if/else ?:.