Re: [PATCH v2] coccinelle: tests: unsigned value cannot be lesser than zero

2015-09-16 Thread SF Markus Elfring
> As we discussed earlier I have dropped idea of adding v <= 0 as it is widely > used in checking ranges, counters, quantities. I find that such a design decision will need more fine-tuning of the suggested small SmPL script. > +@r depends on context || org || report@ > +position p; > +typedef u

Re: [PATCH v2] coccinelle: tests: unsigned value cannot be lesser than zero

2015-09-16 Thread Julia Lawall
Acked-by: Julia Lawall On Wed, 16 Sep 2015, Andrzej Hajda wrote: > Code comparing unsigned variables with zero using operators < or >= does not > make sense. It is always false or true, respectively. However, its presence > often indicates bugs in the code. > gcc can detect it also using -Wtype

[PATCH v2] coccinelle: tests: unsigned value cannot be lesser than zero

2015-09-16 Thread Andrzej Hajda
Code comparing unsigned variables with zero using operators < or >= does not make sense. It is always false or true, respectively. However, its presence often indicates bugs in the code. gcc can detect it also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. S