[FFmpeg-devel] On signedness of AV_NOPTS_VALUE constant

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Sep 19 19:33:15 CEST 2012


On Wed, Sep 19, 2012 at 11:18:24AM +0300, Andrey Utkin wrote:
> 2012/9/18 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> > I guess it is strange, but the 0x8... constant does not fit into int64_t, so I think trying to put it into that invokes undefined behaviour.
> 
> This point is valid. Decreasing this constant makes warning disappear.
> Although applying minus sign doesn't remove the warning.
> 
> > I think it should be defined as INT64_C(-0x8000000000000000) which in practice should give the same value but avoid the undefined aspect.
> 
> Didn't make difference for me, but implicit casting did:
> (int64_t)INT64_C(0x8000000000000000)

That seems wrong to me, I'd suggest opening a bug against the compiler instead.
With the - I can't see any way it could be correct for the compiler to
warn.


More information about the ffmpeg-devel mailing list