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

--- Comment #7 from Alejandro Colomar <alx at kernel dot org> ---
(In reply to Jonathan Wakely from comment #6)
> Not warning at all for a literal -1 seems reasonable to me. It's such a
> common idiom to compare to -1 for error checks.
> 
> So suppress the warning only for the literal -1 (and no other spellings,
> such as -1L or ~0), and only if it's being compared to an unsigned integer
> type of rank not less than the rank of int.

Yes, precisely that.

> The suggestion makes sense to me.

Thanks!  :-)

Reply via email to