Skip to content

Fix -Wincompatible-pointer-types on mingw32

Marc-André Lureau requested to merge elmarco/usbredir:fix into main
../tools/usbredirect.c: In function 'main':
../tools/usbredirect.c:586:29: error: passing argument 2 of 'libusb_set_log_cb' from incompatible pointer type [-Wincompatible-pointer-types]
  586 |     libusb_set_log_cb(NULL, debug_libusb_cb, LIBUSB_LOG_CB_GLOBAL);
      |                             ^~~~~~~~~~~~~~~
      |                             |
      |                             void (*)(libusb_context *, enum libusb_log_level,  const char *)
In file included from ../tools/usbredirect.c:10:
/usr/i686-w64-mingw32/sys-root/mingw/include/libusb-1.0/libusb.h:1353:71: note: expected 'libusb_log_cb' {aka 'void (__attribute__((stdcall)) *)(libusb_context *, enum libusb_log_level,  const char *)'} but argument is of type 'void (*)(libusb_context *, enum libusb_log_level,  const char *)'
 1353 | void LIBUSB_CALL libusb_set_log_cb(libusb_context *ctx, libusb_log_cb cb, int mode);
      |                                                         ~~~~~~~~~~~~~~^~
Edited by Marc-André Lureau

Merge request reports

Loading