[MPlayer-dev-eng] [PATCH] libbs2b audio filter

Andrew Savchenko bircoph at gmail.com
Sat Mar 7 11:07:59 CET 2009


Hi,

On Friday 06 March 2009 17:07, Uoti Urpala wrote:
[...]
> You're calling the function pointer with incompatible arguments.
> Your code now calls "func(f, i)" where 'f' is some "t_bs2bdp"
> type from the library and "i" is a "void *" (BTW using 'i' for
> that is a really poor choice of variable name as 'i' is almost
> always used as a general integer variable).

'i' stands for "iterator", and so it is ;-)

> That means the 
> compiler handles it as if the argument types had been declared
> to be "t_bs2bdp, void *". You only don't get a warning about
> this mismatch because you didn't specify the types normally.

Yes and no. Types are not fully specified at compile type. Types 
specification is required mostly for optimizations and as 
protection from programming errors. In practice compiler will push 
arguments in the stack and jump to the library function enty 
point. Without type check it is up to programmer to verify they 
are correct.

> In short you simply should not use function declarations with
> empty argument lists. The possibility to do that at all is
> marked as an obsolescent feature in the C standard.

Sincerelly I'm not completely satisfied with current solution, but 
I see no better way. We have rather long discussion here, but it 
is mostly theoretical. Have you any practical idea how to avoid 
this and code duplication at the same time?

Yes, this feature is obsolescent, but it is still widely used, too 
widely used to be removed in the foreseeable future and IMO it is 
acceptable in current conditions.

-- 
Best regards,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090307/fffd4f5c/attachment.pgp>


More information about the MPlayer-dev-eng mailing list