[FFmpeg-devel] Moving if(constant expression) to preprocessor?

Bobby Bingham uhmmmm
Sat Sep 18 19:32:23 CEST 2010


On Sat, 18 Sep 2010 18:00:40 +0200
"Axel Holzinger" <aholzinger at gmx.de> wrote:

> Hi M?ns and all,
> 
> M?ns Rullg?rd wrote:
> > "Axel Holzinger" <aholzinger at gmx.de> writes:
> > 
> > > Hi all,
> > >
> > > if compiling FFmpeg code with zero optimisations (even without
> dead 
> > > code elimination) there are linker errors (undefined references to
> 
> > > functions or structs) that come from constructs like i.e. the 
> > > following in libavcodec/allcodecs.c:
> > >
> > > if(CONFIG_##X##_HWACCEL) av_register_hwaccel(&x##_hwaccel); }
> > >
> > > The runtime (lower case) "if" leads to an undefined 
> > reference, because 
> > > it is evaluated at runtime and not at compile time.
> > >
> > > If dead code eliminitation optimisation is on, this isn't an
> issue, 
> > > but with optimisations completely off it is.
> > 
> > Don't do that then.
> 
> Hehe, if we all would be so shy, we would still live in caves,
> wouldn't we :-)
> 

Why do you want to compile without dead code elimination?  I don't see
what the benefit is.  And without a compelling reason, I don't think
it's worth obfuscating the code.

-- 
Bobby Bingham
??????????????????????



More information about the ffmpeg-devel mailing list