[systemd-devel] PATCH: fix sparse warnings

Kok, Auke-jan H auke-jan.h.kok at intel.com
Mon Mar 26 11:37:47 PDT 2012


On Mon, Mar 26, 2012 at 10:43 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 22.03.12 10:32, Kok, Auke-jan H (auke-jan.h.kok at intel.com) wrote:
>
>>
>> On Wed, Mar 21, 2012 at 5:21 PM, Lennart Poettering
>> <lennart at poettering.net> wrote:
>> >> Here is a patch integrating your header (modified as wanted by Lennart)
>> >> and the changes in various locations of journal to use le64_t.
>> >>
>> >> It also fixes some potential endianness errors, please review it
>> >> carefully.
>> >
>> > Looks good to me. Applied!
>> >
>> > Now, one more question, since I actually never used sparse myself:
>> > what's the best way to make use of this? If I run autogen and build this
>> > with CC=cgcc some things look really borked (like generation of the dbus
>> > introspection files goes to stdout). Any suggestions?
>>
>> I'd suggest including this in some 'make test' type target only, but
>> note that most of the stuff sparse throws our are warnings, and so any
>> form of automation isn't really helpful with sparse.
>>
>> Sparse checking is great, just like many other tools like valgrind,
>> etc. , but, skilled eyes are required to make sense of the output.
>
> Sure, I use llvm-analyze and valgrind all the time on systemd. I am just
> curious what the best way to use sparse on it is. Just setting CC=cgcc
> results in a lot of spew, that I can't make sense of, such as the XML
> output being misdirected.

I don't think we can avoid that unless we either limit the stuff being
passed to sparse, or run sparse manually instead of through pipelining
it in the normal compile chain, which is what causes the garbage
output being dumped.

Unfortunately I've never used sparse in that matter - it should be
possible though.

Auke


More information about the systemd-devel mailing list