Package: libpciaccess
Version: 0.13.2-1
Severity: wishlist
Usertags: goto-cc
During an analysis of all Debian packages using our research compiler tool-chain
(using tools from the cbmc package) the following error was found:
[...]
CCLD libpciaccess.la
warning: conflicting pointer types for variable "pci_sys"
old definition in module common_iterator file ../../src/common_init.c line 38
struct pci_system {
const struct pci_system_methods * methods;
unsigned long int num_devices;
struct pci_device_private * devices;
signed int vgaarb_fd;
signed int vga_count;
struct pci_device * vga_target;
struct pci_device * vga_default_dev;
} *
new definition in module linux_sysfs file ../../src/pciaccess_private.h line 183
struct pci_system {
const struct pci_system_methods * methods;
unsigned long int num_devices;
struct pci_device_private * devices;
signed int mtrr_fd;
signed int vgaarb_fd;
signed int vga_count;
unsigned int $pad0;
struct pci_device * vga_target;
struct pci_device * vga_default_dev;
} *
Observe the missing mtrr_fd field in common_iterator's view on the struct type.
Reviewing the code it seems this will anyhow work ok at present as
common_iterator.c does not access any field beyond "devices" - but if it does so
in future, this will have undefined behaviour.
The reason for the type conflict is the missing #include "config.h" in
common_iterator.c, which would set HAVE_MTRR.
Best,
Michael
Attachment:
pgpGXv2mJry24.pgp
Description: PGP signature