avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [patch #8954] Enable usage of libusb-1.0 for stk500v2 (aka


From: Joerg Wunsch
Subject: [avrdude-dev] [patch #8954] Enable usage of libusb-1.0 for stk500v2 (aka avrispmkii)
Date: Sun, 21 Jan 2018 17:21:05 -0500 (EST)
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:57.0) Gecko/20100101 Firefox/57.0

Update of patch #8954 (project avrdude):

                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #1:

This does unfortunately not compile under FreeBSD where the OS
offers a libusb-1.0 API compatible USB library:


usb_libusb.c:265:17: warning: implicit declaration of function
'libusb_has_capability' is invalid in C99
      [-Wimplicit-function-declaration]
            if
(libusb_has_capability(LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER))
                ^
usb_libusb.c:265:39: error: use of undeclared identifier
'LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER'
            if
(libusb_has_capability(LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER))
                                      ^
usb_libusb.c:723:62: warning: passing 'char *' to parameter of type 'uint8_t
*' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
      errcode = libusb_interrupt_transfer(udev, fd->usb.wep, (char *)bp,
tx_size, &rv, 10000);
                                                             ^~~~~~~~~~
/usr/include/libusb.h:549:87: note: passing argument to parameter 'data' here
int     libusb_interrupt_transfer(libusb_device_handle * devh, uint8_t
endpoint, uint8_t *data, int length, int *trans...
                                                                              
           ^
usb_libusb.c:725:57: warning: passing 'char *' to parameter of type 'uint8_t
*' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
      errcode = libusb_bulk_transfer(udev, fd->usb.wep, (char *)bp, tx_size,
&rv, 10000);
                                                        ^~~~~~~~~~
/usr/include/libusb.h:548:82: note: passing argument to parameter 'data' here
int     libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint,
uint8_t *data, int length, int *transferre...
                                                                              
      ^
usb_libusb.c:792:51: warning: passing 'char [512]' to parameter of type
'uint8_t *' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
    errcode = libusb_interrupt_transfer(udev, ep, usbbuf, maxsize, &rv,
10000);
                                                  ^~~~~~
/usr/include/libusb.h:549:87: note: passing argument to parameter 'data' here
int     libusb_interrupt_transfer(libusb_device_handle * devh, uint8_t
endpoint, uint8_t *data, int length, int *trans...
                                                                              
           ^
usb_libusb.c:794:46: warning: passing 'char [512]' to parameter of type
'uint8_t *' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
    errcode = libusb_bulk_transfer(udev, ep, usbbuf, maxsize, &rv, 10000);
                                             ^~~~~~
/usr/include/libusb.h:548:82: note: passing argument to parameter 'data' here
int     libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint,
uint8_t *data, int length, int *transferre...
                                                                              
      ^
usb_libusb.c:897:57: warning: passing 'char [512]' to parameter of type
'uint8_t *' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
      errcode = libusb_bulk_transfer(udev, fd->usb.eep, usbbuf,
                                                        ^~~~~~
/usr/include/libusb.h:548:82: note: passing argument to parameter 'data' here
int     libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint,
uint8_t *data, int length, int *transferre...
                                                                              
      ^
usb_libusb.c:923:64: warning: passing 'char [512]' to parameter of type
'uint8_t *' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
        errcode = libusb_interrupt_transfer(udev, fd->usb.rep, usbbuf,
                                                               ^~~~~~
/usr/include/libusb.h:549:87: note: passing argument to parameter 'data' here
int     libusb_interrupt_transfer(libusb_device_handle * devh, uint8_t
endpoint, uint8_t *data, int length, int *trans...
                                                                              
           ^
usb_libusb.c:926:59: warning: passing 'char [512]' to parameter of type
'uint8_t *' (aka 'unsigned char *') converts between
      pointers to integer types with different sign [-Wpointer-sign]
        errcode = libusb_bulk_transfer(udev, fd->usb.rep, usbbuf,
                                                          ^~~~~~
/usr/include/libusb.h:548:82: note: passing argument to parameter 'data' here
int     libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint,
uint8_t *data, int length, int *transferre...
                                                                              
      ^


So it seems the libusb_has_capability() needs an explicit
probing in configure.ac as it has not always been part of
the libusb-1.0 API.  (Unfortunately, LIBUSB_CAP_HAS_CAPABILITY
is part of an enum rather than a #define, so it cannot be
tested at compile-time.  Seems someone didn't really think
about that detail before.)

The warnings about char vs. uint8_t * can probably safely
be silenced using typecasts.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8954>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]