Re: [PATCH] maint: Kill usage of atoi()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]