[libdvdnav-devel] By The Way...

John Stebbins jstebbins at jetheaddev.com
Fri Jan 16 04:17:42 CET 2015


On 01/15/2015 07:01 PM, Lawrence D'Oliveiro wrote:
> ...just for fun, I tried building libdvdread with “CC=clang”. It
> generated a whole lot of “warning: unknown attribute 'gcc_struct'
> ignored [-Wunknown-attributes]”, but otherwise actually compiled and
> linked! (I didn’t try actually installing and using it...)
>
> Looking at the sources of these warnings, there are a whole lot of
> packed structs with bitfields in them (using the ATTRIBUTE_PACKED
> macro). I don’t think such structs are portable across big/little
> endian, let alone across C compilers.
>
> The only portable way to do bitfields in C is to use shifting and
> masking.
>

FYI, dvdread and dvdnav work fine when compiled with clang. HandBrake 
has been compiling them with clang on osx for years.  I suppose I should 
have looked into silencing those warnings long ago, but it just never 
got to the top of my TODO list.


More information about the libdvdnav-devel mailing list