asterisk / dahdi-linux

This is the official dahdi-linux repository. All issues and PR should be raised here.
GNU General Public License v2.0
47 stars 69 forks source link

drivers/dahdi: fix build with clang-16 #21

Closed listout closed 1 year ago

listout commented 1 year ago

clang-16 enables -Werror=incompatible-pointer-types (along with buch of other warnings) by default, thus resulting in errors such as:

/var/tmp/portage/net-misc/dahdi-3.2.0/work/dahdi-linux-3.2.0/drivers/dahdi/dahdi-sysfs.c:272:27: error: initialization of �-Werror=incompatible-pointer-types][]]
  272 |         .uevent         = span_uevent,
      |                           ^~~~~~~~~~~
/var/tmp/portage/net-misc/dahdi-3.2.0/work/dahdi-linux-3.2.0/drivers/dahdi/dahdi-sysfs.c:272:27: note: (near initialization for ‘spans_bus_type.uevent’)
/var/tmp/portage/net-misc/dahdi-3.2.0/work/dahdi-linux-3.2.0/drivers/dahdi/dahdi-sysfs.c:709:27: error: initialization of �-Werror=incompatible-pointer-types][]]
  709 |         .uevent         = device_uevent,
      |                           ^~~~~~~~~~~~~

This patch modifes some of the fucntions parameter types, making dahdi possible to be built with clang-16.

Bug: https://bugs.gentoo.org/906179

listout commented 1 year ago

Feed back is always welcome