[DVDnav-discuss] additional patches to libdvdnav

Erik Hovland erik at hovland.org
Sat May 10 00:31:40 CEST 2008


On Sat, May 10, 2008 at 01:40:15AM +0200, Nico Sabbi wrote:
> Il Thursday 08 May 2008 18:26:22 Erik Hovland ha scritto:
> > 1. src_dvdread-remove-unnecessary-headers.patch
> >    It turns out that bitreader.c doesn't need bswap.h and ifo_print.c no
> >    longer has any reference to the WORDS_BIGENDIAN macro
> 
> thanks, applied
> 
> > 
> > 2. src_dvdread_dvd_udf.c-do-deep-copy-of-AD-struct.patch
> >    Some compilers may not respect 'struct foo = bar;', so it is
> >    safer to do a deep copy with memcpy to make sure that the struct is
> >    always copied.
> 
> 
> really? are they just broken or is there anything in the C and C++
> standards that permits such difference in behaviour?

Well, this is the thing. GCC does the right thing. But there is nothing
in the C standard that says explicitly that structs should be fully
assigned. And there are compilers out there that use this as a way to
boost performance.

So 95% of the time this is not going to be a problem.

In this case, the problem would manifest itself as the struct member
Partition being uninitialized and then either being assigned to
something else.

If the patch is accepted that 95% will go to 100%. Seeing as this patch
is pretty small - I think it is OK to consider it.

But hey, there are probably a lot of developers out there who use the
same idiom and are not experiencing any problems.

Side note: This patch has been accepted into the trunk of MythTV. So it
has had light testing.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request




More information about the DVDnav-discuss mailing list