bug-gnulib
[Top][All Lists]
Advanced

[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 23:38:40 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Michal Privoznik wrote:

it's not a false positive either

It depends on what we're looking for. I'm looking for bugs. To take an extreme example, if GCC warned about every character string literal containing an unescaped ASCII apostrophe, on the grounds that the apostrophe could be a typo and program quality would be improved by requiring programmers to manually check and explicitly escape every string-literal apostrophe, I'd disable such a warning first thing. Any benefits of the warning would not be worth the hassle.

The warning we're talking about is not as bad as this hypothetical example. But it's pretty bad. I'd rather not contort good code to pacify it.

Try running 'make syntax-check' which fails because of gnulib's
copyright_check.

This sounds like a different and unrelated problem.

BTW: the patch of yours don't help really. Firstly, unused-parameter
sneaks back in (through -Wextra I assume). And secondly, in libvirt we
want to use Wunused-parameter and we do mark unused parameters
explicitly (see ATTRIBUTE_UNUSED macro).

In that case, I suggest doing what coreutils and other programs do: use a different set of warnings for Gnulib code than for the libvirt code. You can specify -Wno-unused-parameter just for Gnulib; this will override -Wextra.



reply via email to

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