[FFmpeg-devel] [PATCH] libavcodec/wmavoice.c: local variable pow might mask pow function

Axel Holzinger aholzinger
Sun Jul 25 21:18:43 CEST 2010


On Sun, Jul 25, 2010 at 8:49 PM, Eli Friedman wrote:
> On Sun, Jul 25, 2010 at 11:24 AM, Axel Holzinger 
> <aholzinger at gmx.de> wrote:
> > Hi M?ns et al,
> >
> > On Sun, Jul 25, 2010 at 7:51 PM, M?ns Rullg?rd:
> >> "Axel Holzinger" <aholzinger at gmx.de> writes:
> >>
> >> > Hi,
> >> >
> >> > in libavcodec/wmavoice.c local variable float pow (line
> >> 585) can mask
> >> > pow function if powf (line 595) is a #define and defined
> >> for example
> >> > like
> >> > #define powf(x,y) ? ((float)pow((double)(x), (double)(y)))
> >>
> >> But we never do that.
> >
> > No, you don't do that. Why should you?
> >
> > But some C library implementations do that. How could you know
they 
> > don't?
> 
> We "know" because such an implementation wouldn't conform to 
> the standard... the standard headers aren't allowed to assume 
> that pow doesn't refer to a local variable.

The standard headers never "assume" anything about local variable
naming. They don't care on local variable naming. We users of the
standard headers should.

The issue is that a local variable pow masks a function pow and that
hurts if powf - which is used in the scope of local variable pow - is
not a function but a macro using double precision pow function.

Besides taking the effort to apply and document a patch, what do you
think stands against the patch?

Cheers
Axel




More information about the ffmpeg-devel mailing list