On 11/14/13 22:53, Eric Blake wrote:
On 11/14/2013 02:22 PM, Peter Krempa wrote:
>>> +
>>> +exclude_file_name_regexp--sc_prohibit_atoi= \
>>> + ^examples/.*\.[ch]$$
>>
>> Drop this hunk. None of our examples/* use atoi to begin with, so
>> there's no reason to exclude them from the syntax check.
>>
>> ACK with those fixes.
>>
>
> This isn't true unfortunately:
Huh, wonder what grep I did that missed that fact?
>
> ~/libvirt $ git grep atoi examples/
> examples/domsuspend/suspend.c: id = atoi(argv[1]);
>
> and I wanted to avoid changing that file. But if you insist I can tune
> that one too.
Yes, it's worth fixing, because our examples should never teach people
to use bad coding practices. atoi() is broken by design, and strtol(),
while more awkward to use, is just as portably present as atoi().
Well, the file is a bad example by itself. The first issue would be that
it doesn't work. It tries to suspend(pause) a VM using the RO connection.
That file should be refactored as a whole piece instead of trying to
polish parts that won't even work.
Peter