[Ffmpeg-devel] meta-discussion Re: [PATCH] part 8 - portability fixes (ILP32 vs LP64)

Rich Felker dalias
Mon Jan 30 20:38:02 CET 2006

On Mon, Jan 30, 2006 at 06:11:52PM -0000, M?ns Rullg?rd wrote:
> > Therefore I turn on the prototype/decl related warnings.
> >
> > I view the resulting warnings, and their fixes, as being
> > related to portability between CPU architectures.  You are
> > of course welcome to view them differently, but I cannot
> > read your mind.
> If you turn up the warning levels to for whatever reason, that does not
> make all warnings generated related to that reason.  Specifically, warnings
> about missing prototypes never have anything to do with machine word size.

Actually they do, but not in Dieter's nonsense case where the
functions are defined prior to their use. Consider something like:

int foo(char *);

If I'm missing this prototype and call it with foo(0) on a system
where sizeof(char *) > sizeof(int), bad things will happen.

Even if I explicitly use foo((char *)0), it may not work, since
functions without prototypes are considered equivalent to 'old style'
functions (like those with variable # of arguments) and may need to
use a different calling convention (arguments on stack instead of in
registers) on architectures with register-passing and such.

So in summary, lack of declaration before using a function _is_ a
portability problem, but the function declaration doubles as a
definition, obviously.


More information about the ffmpeg-devel mailing list