[MPlayer-cvslog] r24918 - in trunk: libaf/af.c libaf/af_tools.c libaf/filter.c libaf/format.c libvo/x11_common.c

Uoti Urpala uoti.urpala at pp1.inet.fi
Thu Nov 1 22:31:04 CET 2007


On Thu, 2007-11-01 at 05:20 -0400, Rich Felker wrote:
>> -inline int af_resize_local_buffer(af_instance_t* af, af_data_t*
data)
>> +int af_resize_local_buffer(af_instance_t* af, af_data_t* data)
>
> Is non-static inline even valid C? I doubt it... This looks like C++
> code masquerading as C......

It is valid C. See part 6.7.4 of the C standard.

If a function is declared with an inline specifier then it must be
defined in the same translation unit. If all the declarations and
definition have 'inline' but none have 'extern' then the compiler may
either inline the code from that definition or call the external
function (which must exist in another translation unit). If there is a
declaration without 'inline' or with 'extern' then this translation unit
will generate the external definition.

This particular case was valid because the declaration without 'inline'
from af.h was visible, so an external definition would be created.
However it was also completely pointless because there were no calls to
the function in the translation unit where this 'inline' specifier was
visible so it could not have any effect.




More information about the MPlayer-cvslog mailing list