On 11/14/13 17:28, Eric Blake wrote:
On 11/14/2013 09:20 AM, Peter Krempa wrote:
> Also fix a typo in variable name holding the cylinders count of a disk
> pool (apparently unused).
If we're going to kill atoi(), let's also kill atof, atol, atoq, atoll.
Ok, these can be killed free of charge. None of them is used in libvirt
code. I'll add them to the syntax-check rule.
Oh, and maint.mk already has a rule that does this; we just have it
disabled because we aren't clean yet (it also prohibits *scanf, because
that also has undefined behavior on overflow; but we haven't scrubbed
our sources to get rid of scanf usage).
There's a ton of *scanf usage which will not be trivial to kill.
>
> +sc_prohibit_atoi:
> + @prohibit='\batoi *\(' \
> + exclude='exempt from syntax-check' \
What are we exempting? You can probably drop this line.
Right I now figured out what this is used for :).
> + halt='Use virStrToLong* instead of atoi' \
This at least is a more specific message than the generic check in maint.mk.
V2 comming soon.
Peter