Hi GNUser
... ----- Snip -----
spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c.o -c ../spa/plugins/v4l2/v4l2-udev.c
../spa/plugins/v4l2/v4l2-udev.c: In function ‘remove_device’:
../spa/plugins/v4l2/v4l2-udev.c:136:21: error: void value not ignored as it ought to be
136 | device->dev = udev_device_unref(device->dev);
| ^
----- Snip -----
Gcc is saying udev_device_unref returns a void and its being
assigned to a non-void variable (device->dev)
According to this:
https://manpages.debian.org/testing/libudev-dev/udev_device_unref.3.en.html#SYNOPSISudev_device_unref returns a struct udev_device pointer.
And here it states:
https://manpages.debian.org/testing/libudev-dev/udev_device_unref.3.en.html#RETURN_VALUEudev_device_unref always returns NULL.
According to this:
http://ftp.ntu.edu.tw/linux/utils/kernel/hotplug/libudev/libudev-udev-device.html#udev-device-unrefudev_device_unref return type as void.
/usr/local/include/libudev.h from udev-dev.tcz also defines
udev_device_unref return type as void.
If you look in spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c you'll
see udev_device_unref is used 3 times, but only 1 of those times
is there an attempt to use the return value:
static void remove_device(struct impl *this, struct device *device)
{
device->dev = udev_device_unref(device->dev);
stop_watching_device(this, device);
*device = this->devices[--this->n_devices];
}
Based on the name of the function (remove_device) and what the
author did, it appears he wanted to set device->dev equal to NULL
using the return value of udev_device_unref.
If that is the case, the source should probably be changed to this:
static void remove_device(struct impl *this, struct device *device)
{
udev_device_unref(device->dev);
device->dev = NULL;
stop_watching_device(this, device);
*device = this->devices[--this->n_devices];
}