https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80793

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warnings aren't incorrect, there are just too many of them for what boils
down to essentially the same problem.  It's true that the operands of the
conditional expression have mixed signedness.  It's also true (and obvious
given the first message) that one of the operands has to be converted to the
type of the other.  And finally, it's true that the subsequent conversion of
one of the two converted operands results in changing its value (if that
operand happens to be the the result of the ternary expression).  But issuing
three warnings for these three closely related problems doesn't make it or the
solution clearer.  In fact, I think it can do the opposite and confuse the user
(especially the last one).

But my general point is not about these three warnings in particular but rather
that while GCC makes an effort to avoid diagnosing the same problem or even the
same expression multiple times (TREE_NO_WARNING), the increasing number of
specialized warning options tends to make the interactions between them too
subtle to achieve the right balance (or even decide what the right balance is).

Reply via email to