[MPlayer-dev-eng] [MPlayer-cvslog] [PATCH] GCC: Do not warn about unused paramters (was Re: r36
Ingo Brückl
ib at wupperonline.de
Thu Feb 27 00:32:00 CET 2014
Alexander Strasser wrote on Wed, 26 Feb 2014 17:26:09 +0100:
> On 2014-02-26 16:05 +0100, Ingo Brückl wrote:
>> Alexander Strasser wrote on Wed, 26 Feb 2014 15:22:33 +0100:
>>
>> > BTW @ all:
>> > Why don't we have -Wno-unused-parameter in CFLAGS?
>>
>> > I can hardly even think of a case where an unused parameter warning
>> > would be relevant. Also I cannot remember a single occasion where it
>> > mattered in practice.
>>
>> An unused variable (besides one in a callback function that has a fixed
>> parameter list) is either a leftover or bad programming style (IMO).
>> I want to be informed about any junk lying around.
>>
>> And for the mentioned callback functions something like mp_unused() would
>> indicate that not all of the parameters are relevant in this particular case
>> (while allowing the usage of -Wunused-parameter).
>>
>> > Adding the above mentioned flag eliminates 2000+ unused parameter
>> > warnings here if I did not mess up my measurements.
>>
>> > Patch attached.
>>
>> No surprise, I object.
> That is fine, but naturally I disagree with you on that point :)
Sure you do. :-)
> First your leftover/bad programming argument can be helped better
> by re-iterating over the functions taking a hard look at their docs
> (if available) and signature (including name, parameters, and return
> type) and a glimpse over their respective function bodies.
Well, if it were so easy, you wouldn't need compiler warnings at all.
Actually, it often is just the warnings that point out to have a closer
and harder look. I consider (as much) compiler warning options (as possible
and reasonable) a valuable help. (Which is the reason why I'm using a few
more locally.)
Ingo
More information about the MPlayer-dev-eng
mailing list