[DVDnav-discuss] Type casting in navPrint_PCI_GI

Frantisek Kluknavsky fkluknav at redhat.com
Tue Dec 4 16:30:53 CET 2012


Hi,

my compiler complains about violating -fstrict-aliasing (turned on with 
sane "gcc -O2") in nav_print.c:39.The line says:
printf("vobu_uop_ctl  0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl);

vobu_uop_ctl is a big structure. Its first element is "unsigned int zero 
: 7;" followed by many other integer elements. I am not sure, what is 
the meaning or use of that information, but taking first 32 bits seems 
weird at a first glance.

Of course -fno-strict-aliasing is a workaround. I just want to check it 
is not a bug.

Live well,

Frantisek Kluknavsky



More information about the DVDnav-discuss mailing list