On Mon, Apr 11, 2011 at 09:44:49AM -0400, Ronald S. Bultje wrote: > > On Sun, Apr 10, 2011 at 3:44 PM, Diego Biurrun <[email protected]> wrote: > > When HAVE_7REGS was not defined these functions had an empty body > > causing the following warnings during compilation. > > In file included from libswscale/x86/yuv2rgb_mmx.c:58: > > libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_rgb32_MMX’: > > libswscale/x86/yuv2rgb_template.c:412: warning: no return statement in > > function returning non-void > > libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_bgr32_MMX’: > > libswscale/x86/yuv2rgb_template.c:457: warning: no return statement in > > function returning non-void > > > > Signed-off-by: Diego Biurrun <[email protected]> > > > > --- a/libswscale/x86/yuv2rgb_template.c > > +++ b/libswscale/x86/yuv2rgb_template.c > > @@ -406,6 +406,8 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, > > const uint8_t *src[], > > YUV2RGB_OPERANDS_ALPHA > > YUV2RGB_ENDFUNC > > +#else > > + return 0; > > #endif > > > > @@ -449,5 +451,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, > > const uint8_t *src[], > > YUV2RGB_OPERANDS_ALPHA > > YUV2RGB_ENDFUNC > > +#else > > + return 0; > > #endif > > This isn't right. You're declaring empty functions for stuff that is > supposed to do something. In x86/yuv2rgb_mmx.c, you'll see these > functions are only called under if (HAVE_7REGS) anyway, so the proper > fix is to not declare these functions at all, i.e. move the #if > HAVE_7REGS outside the function declaration. Dead code elimination > should take care of the rest.
gcc does not quite agree with you: CC libswscale/x86/yuv2rgb_mmx.o libswscale/x86/yuv2rgb_mmx.c: In function ‘ff_yuv2rgb_init_mmx’: libswscale/x86/yuv2rgb_mmx.c:70: error: ‘yuva420_rgb32_MMX2’ undeclared (first use in this function) libswscale/x86/yuv2rgb_mmx.c:70: error: (Each undeclared identifier is reported only once libswscale/x86/yuv2rgb_mmx.c:70: error: for each function it appears in.) libswscale/x86/yuv2rgb_mmx.c:75: error: ‘yuva420_bgr32_MMX2’ undeclared (first use in this function) libswscale/x86/yuv2rgb_mmx.c:88: error: ‘yuva420_rgb32_MMX’ undeclared (first use in this function) libswscale/x86/yuv2rgb_mmx.c:93: error: ‘yuva420_bgr32_MMX’ undeclared (first use in this function) make: *** [libswscale/x86/yuv2rgb_mmx.o] Error 1 Diego _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
