[MacPorts] #61868: libusb @1.0.24: cannot parse USB.h with mainline gcc versions due to variant pragma handling not accepted by gcc

MacPorts noreply at macports.org
Sun Nov 21 02:45:57 UTC 2021


#61868: libusb @1.0.24: cannot parse USB.h with mainline gcc versions due to
variant pragma handling not accepted by gcc
-----------------------------------+-----------------------
  Reporter:  dgonyier              |      Owner:  michaelld
      Type:  defect                |     Status:  closed
  Priority:  Normal                |  Milestone:
 Component:  ports                 |    Version:  2.6.4
Resolution:  fixed                 |   Keywords:
      Port:  libusb, libusb-devel  |
-----------------------------------+-----------------------

Comment (by barracuda156):

 Applying the patch above did not work for me on 10.6 PPC:


 {{{
 In file included from os/darwin_usb.c:26:0:
 /usr/include/pthread.h:361:6: note: expected 'char *' but argument is of
 type 'const char *'
  int  pthread_setname_np(char*);
       ^~~~~~~~~~~~~~~~~~
 In file included from os/darwin_usb.h:26:0,
                  from os/darwin_usb.c:49:
 os/darwin_usb.c: In function 'darwin_get_cached_device':
 os/darwin_usb.c:1011:16: warning: format '%x' expects argument of type
 'unsigned int', but argument 6 has type 'UInt32 {aka long unsigned int}'
 [-Wformat=]
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
                 ^
 ./libusbi.h:287:67: note: in definition of macro '_usbi_log'
  #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __func__,
 __VA_ARGS__)
 ^~~~~~~~~~~
 os/darwin_usb.c:1011:7: note: in expansion of macro 'usbi_dbg'
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
        ^~~~~~~~
 os/darwin_usb.c:1011:64: note: format string is defined here
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
                                                                ~^
                                                                %lx
 In file included from os/darwin_usb.h:26:0,
                  from os/darwin_usb.c:49:
 os/darwin_usb.c:1011:16: warning: format '%x' expects argument of type
 'unsigned int', but argument 8 has type 'UInt32 {aka long unsigned int}'
 [-Wformat=]
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
                 ^
                 sessionID, locationID, new_device->session,
 new_device->location);
                                                             ~~~~~~~~~~~~~
 ./libusbi.h:287:67: note: in definition of macro '_usbi_log'
  #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __func__,
 __VA_ARGS__)
 ^~~~~~~~~~~
 os/darwin_usb.c:1011:7: note: in expansion of macro 'usbi_dbg'
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
        ^~~~~~~~
 os/darwin_usb.c:1011:131: note: format string is defined here
        usbi_dbg("matching sessionID/locationID 0x%" PRIx64 "/0x%x against
 cached device with sessionID/locationID 0x%" PRIx64 "/0x%x",
 ~^
 %lx
 make[2]: *** [os/darwin_usb.lo] Error 1
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libusb/libusb/work
 /libusb-libusb-c6a35c5/libusb'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory
 `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libusb/libusb/work
 /libusb-libusb-c6a35c5'
 make: *** [all] Error 2
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libusb/libusb/work
 /libusb-libusb-c6a35c5'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libusb/libusb/work/libusb-1.0.24"
 && /usr/bin/make -j1 -w all AM_DEFAULT_VERBOSITY=1
 Exit code: 2
 Error: Failed to build libusb: command execution failed
 Error: See
 /opt/local/var/macports/logs/_opt_PPCSnowLeopardPorts_devel_libusb/libusb/main.log
 for details.
 Error: Follow https://guide.macports.org/#project.tickets if you believe
 there
 is a bug.
 Error: Processing of port libusb failed

 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/61868#comment:62>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list