[FFmpeg-cvslog] r11573 - trunk/libavformat/mxf.c
Måns Rullgård
mans
Sun Jan 20 14:34:15 CET 2008
Rich Felker <dalias at aerifal.cx> writes:
> On Sun, Jan 20, 2008 at 12:13:00AM +0000, M?ns Rullg?rd wrote:
>> > For structs, memset and memcpy are much better than assignment or
>> > initialization, which are not guaranteed to zero out any padding. This
>> > is not an issue of implementation but of what the C language itself
>> > guarantees.
>>
>> If there is padding in a struct, those bytes should never be
>> explicitly read or written anyway, so it does not matter whether they
>> are initialised. Code that depends in any way whatsoever on the value
>> of padding bytes is *broken*. It may of course be faster to zero/copy
>> everything, but that is, as you say, up to the implementation.
>
> Using memcmp for structure comparison is valid, but only as long as
> you zero the padding bytes first.
And comparing structs is something we do *all* the time... right.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-cvslog
mailing list