Re: [libvirt] [PATCH] storage_backend.c: assure clang that inputvol can't be NULL

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

 



Daniel P. Berrange wrote:

> On Thu, Sep 03, 2009 at 11:18:00AM +0200, Jim Meyering wrote:
>> clang was complaining that a NULL inputvol would be dereferenced
>> in that "could not open..." diagnostic.
>>
>> Since the two sole callers of this function are careful
>> to call it only when inputvol is non-NULL, this is a good
>> case for giving the parameter the nonnull attribute:
>
> ACK.
>
> BTW, how exactly are you getting all these warnings/diagnostics ?
> Are you merely compiling libvirt using clang & just collecting
> the warnings, or is this some special static analysis tool ?
>
> If we're going to start adding these non-null attributes, then
> I should hook the appropriate tool into autobuild.sh to validate
> them regularly.

Definitely.

I built llvm/clang per instructions here:

    http://clang-analyzer.llvm.org/

Than ran them like this:

    scan-build -o clang ./autogen.sh
    scan-build -o clang make

That produces a bunch of html in the -o-specified dierctory, clang/.
Point your browser at clang/*/index.html to view the results.

--
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]