[Top][All Lists]

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

Re: [PATCH] Avoid one "parameter unused" warnings.

From: Paul Eggert
Subject: Re: [PATCH] Avoid one "parameter unused" warnings.
Date: Mon, 1 Jan 2018 10:41:50 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Michal Privoznik wrote:
I'm failing to see why this would be a
false positive.

It's a false positive in the sense that there is no bug here. That is, the Gnulib patch would mean that we would be spending maintenance effort to complicate code merely to pacify a compiler, not to fix a real problem. Sometimes this is worth doing, if the compiler's warning is typically a valid one and is therefore useful to catch bugs. However, this particular case does not seem to be worth doing, as this particular compiler warning is too often a false alarm and the bugs it catches are not worth the maintenance effort.

Despite this function being inlined, compiler might
decide to not inline it and thus treat it as any other function in which
case the variable is unused indeed.

I don't see why inlining is relevant. Regardless of whether the compiler decides to inline at the machine-code level, the extra source-code clutter does not fix any real bug.

I attempted to reproduce the problem by running these commands on Fedora 27 

git clone git://libvirt.org/libvirt.git
cd libvirt
make -j5

This worked fine for me, so I can't easily test a fix; however, perhaps the attached patch to libvirt will fix things for you.

Attachment: libvirt.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]