On Thu, Aug 28, 2014 at 05:22:42PM -0700, Timothy Gu wrote: > On Aug 28, 2014 6:14 AM, "Michael Niedermayer" <michae...@gmx.at> wrote: > > > > buf is assigned to AVIOContext.buffer, which is written to by some > > functions using AVIOContext > > Doesn't const only apply to this particular function? In other words, > doesn't const only guarantee that it is not changed inside this particular > function?
if the function has a access to a non const version of the pointer it very well can change its content like in func(dst, dst); where one is const and the other is not but from the link below "From the C99 specs (6.7.3 Type qualifiers): If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non-const-qualified type, the behavior is undefined. " from http://stackoverflow.com/questions/8836418/is-const-casting-via-a-union-undefined-behaviour (maybe not the clearest and best reference to it but thats what i found) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel