[FFmpeg-cvslog] r22091 - in trunk/libavcodec: ivi_common.c ivi_common.h

Reimar Döffinger Reimar.Doeffinger
Sun Feb 28 19:32:32 CET 2010


On Sun, Feb 28, 2010 at 07:23:37PM +0100, Reimar D?ffinger wrote:
> On Sun, Feb 28, 2010 at 08:08:05PM +0200, Kostya wrote:
> > On Sun, Feb 28, 2010 at 06:58:43PM +0100, Michael Niedermayer wrote:
> > > On Sat, Feb 27, 2010 at 01:12:56PM +0100, kostya wrote:
> > > > Author: kostya
> > > > Date: Sat Feb 27 13:12:56 2010
> > > > New Revision: 22091
> > > > 
> > > > Log:
> > > > Make it clear that ff_ivi_init_static_vlc() does not need arguments
> > [...]
> > > 
> > > can we add this as -Werror= ?
> > > its a reoccuring mistake that can lead to actual bugs due to lack of
> > > argument type checking
> > 
> > Any theoretical or real-world examples?
> 
> #include <stdio.h>
> void test();
> int main(void) {
>     test(12.0);
> }
> void test(int arg) {
>     printf("test got %i\n", arg);
> }
> 
> results in:
> test got 0
> 
> Basically you lose most of the advantages of including the header both where
> you implement and where you use your function.

Note that this particular example also has the side-effect of making it
impossible for gcc to inline the function, even the always_inline attribute
is ignored - and only if the types mismatch.
So gcc actually has code that in this case even notices something very special
goes on, but it does not warn about it.



More information about the ffmpeg-cvslog mailing list