[FFmpeg-devel] [PATCH] Fix warning about decode_mb_skip (in libavcodec/h264.h)

Måns Rullgård mans
Tue Jul 6 14:30:39 CEST 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Tue, Jul 06, 2010 at 01:11:30PM +0100, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> 
>> > On Thu, Jul 01, 2010 at 11:56:32PM +0100, M?ns Rullg?rd wrote:
>> >> Michael Niedermayer <michaelni at gmx.at> writes:
>> >> 
>> >> > On Tue, Jun 29, 2010 at 10:06:12PM -0700, Eli Friedman wrote:
>> >> >> Patch attached; fixes warning "'decode_mb_skip' defined but not used".
>> >> >>  As far as I can tell, doesn't have any significant effect on the
>> >> >> generated code, since the function in question gets inlined either
>> >> >> way.
>> >> >
>> >> > feel free to add av_unused
>> >> 
>> >> I'd rather you did one of the following:
>> >> 
>> >> 1.  If the intent is to inline the function, mark it inline.
>> >> 2.  If not, move it to a .c file of your choosing and make it extern.
>> >> 3.  If only used from one .c file, move it there.
>> >
>> > The C language contains (non inline) static functions and they are usefull.
>> >
>> > Files that use some templating system will sometimes contain functions that
>> > are unused in some configurations.
>> > It is possible that these functions are static.
>> > It is possible that we want these functions to be static, compare the non
>> > templated case. By switching from non templated to templated the reasons
>> > for a function to be static do not suddenly cease to apply.
>> > There is no reason to forbid this combination. Nor is there any reason to
>> > throw hours of time at trying to avoid this combiation, this would be
>> > like forbidding any other arbitrary feature of the language.
>> > also the function might contain a different implementation in different
>> > cases of the template making it non static would then not be practical
>> > without passing its name through a renaming macro.
>> 
>> Templating is all well and good, ...
>> 
>> > and av_unused silences the warning, so we do have a clean solution to get
>> > rid of the warning.
>> >
>> > Also its not much hassle to once in a while run a scipt that checks if
>> > av_unused marked symbols are used anywhere.
>> > what does that need? 2 grep commands in a loop?
>> >
>> > I really dont understand what problem you have with simply adding av_unused
>> 
>> ... but I don't see any templating being done with this function.
>
> there is code specific to interlacing, to b frames to direct spatial mode
> in there that we had discussed briefly if we should try to template
> on paff / frame types and so on
> it also calls fill_decode_caches() which is templated on CABAC/CAVLC already

Fine then.  Why didn't just say so instead of trolling about gcc being
stupid?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list