It's not really an explanation though. It's how the language should work.
That ternary operator "?" is just an if-statement which should have the same "problem" with an int argument. It is a broken compiler that would complain about an if statement but an identical ?-statement.
If the int nature of equals-to was a problem, you'd have to use limit its use to switch statements.
There's no problem with the "int argument". (Not sure if you mean the function argument ("reg") or the operand of the conditional operator, but either way not a problem.) The conflict is between the declared return type of the function and the type of the returned expression.
No, it could not. The controlling expression of any kind of conditional statement in C can be an integer. The return type of a function which returns boolean, though, should be boolean.
The strict requirement in the standard is just a 'scalar type': every conditional expression in C, even `if (true)`, technically evaluates on unequal comparison to zero. See section 6.8.4.1 "The if statement" of the standard:
This applies to ternary operators, if statements, do/while loops, for loop termination conditions, etc.
However, when defining a function that returns boolean, you've asked the compiler to make your program more strict than just returning an integer that's zero or nonzero, you're not allowed to return anything but 'true' or 'false' - no, you're not allowed to pack in error codes after the fact!
That ternary operator "?" is just an if-statement which should have the same "problem" with an int argument. It is a broken compiler that would complain about an if statement but an identical ?-statement.
If the int nature of equals-to was a problem, you'd have to use limit its use to switch statements.