[FFmpeg-devel] [PATCH] mpeg12: fix non-standard use of "extern inline"

Uoti Urpala uoti.urpala
Sat May 16 20:35:35 CEST 2009


On Sat, 2009-05-16 at 19:09 +0100, M?ns Rullg?rd wrote:
> Uoti Urpala <uoti.urpala at pp1.inet.fi> writes:
> 
> > On Sat, 2009-05-16 at 14:16 +0100, Mans Rullgard wrote:
> >> Rename ff_mpeg1_decode_block_intra to mpeg1_decode_block_intra and
> >> make it static.  Add ff_mpeg1_decode_block_intra as plain extern
> >> function calling mpeg1_decode_block_intra.
> >
> > Wouldn't just deleting the "inline" specifier from mpeg12.h be enough?
> 
> Then the calls to it in the same file are no longer inlined.

They definition in the same file would still have the "inline"
specifier, so nothing should change in that regard.

> The problem with "extern inline" is that the standard says one thing,
> and gcc does another.

Yes I'm aware of that. Actually it's only old GCC; current versions do
the right thing if you use -std=gnu99 or -std=c99. However even old GCC
does the right thing if you do not use "extern inline" but have an
extern declaration and a _separate_ inline definition. In
standard-conforming compilers that means the same as "extern inline",
but in old GCC it does not trigger its version of "extern inline". And
that would be the case here: the only file which sees an "inline"
specifier at all has both "inline" (without "extern") and a separate
extern declaration from the header.

>   We are relying on the gcc behaviour here.  A
> strictly conforming C99 compiler will not compile that code.

I think the result is that it compiles, but there is then a definition
of the same function in two files and it's up to the linker how it
handles that.




More information about the ffmpeg-devel mailing list