This helps find logic errors, mostly where the programmer thought the
variable was signed but it's actually unsigned, e.g. if (ret < 0) for a
function that returns (ULONG)-1.
I also don't see how the fix would be complicated in most cases.
(x <= 0) becomes (x == 0), (x < 0) becomes (x == (ULONG)-1) or whatever
(after a logic review).
I know that it'll be problematic if resulting from a macro... but I
think it's worth finding a workaround for those cases.
Most of the warnings I remember from our code base though (especially
ntoskrnl) didn't involve macros and were actually cases of questionable
logic... although maybe I recall incorrectly.
On 2014-05-31 23:26, tkreuzer(a)svn.reactos.org wrote:
[CMAKE] Get rid of -Wtype-limits, it's noisy, it
doesn't provide any reasonable benefit and it's almost impossible to
"fix" these warnings without huge haxxory.