From: Martin Mares Date: Fri, 21 Jan 2022 13:09:16 +0000 (+0100) Subject: pci.h: The error callback is now declared with PCI_NONRET X-Git-Tag: v3.8.0~58 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=eeef8fed3e6bd34c553ee8cb16d5fc1b703120af;p=pciutils.git pci.h: The error callback is now declared with PCI_NONRET Users of the repeatedly complain that the library crashes, which is usually caused by providing an error hook which returns to the library. Let's try warning them more explicitly. --- diff --git a/lib/init.c b/lib/init.c index caa57ec..e8bc937 100644 --- a/lib/init.c +++ b/lib/init.c @@ -96,7 +96,7 @@ static int probe_sequence[] = { -1, }; -static void +static void PCI_NONRET pci_generic_error(char *msg, ...) { va_list args; diff --git a/lib/pci.h b/lib/pci.h index 8142476..328a468 100644 --- a/lib/pci.h +++ b/lib/pci.h @@ -62,7 +62,7 @@ struct pci_access { int debugging; /* Turn on debugging messages */ /* Functions you can override: */ - void (*error)(char *msg, ...) PCI_PRINTF(1,2); /* Write error message and quit */ + void (*error)(char *msg, ...) PCI_PRINTF(1,2) PCI_NONRET; /* Write error message and quit */ void (*warning)(char *msg, ...) PCI_PRINTF(1,2); /* Write a warning message */ void (*debug)(char *msg, ...) PCI_PRINTF(1,2); /* Write a debugging message */