[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
Fri Jan 29 12:45:47 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: reopened
Priority: Normal | Milestone:
Component: ports | Version: 2.6.4
Resolution: | Keywords:
Port: libusb, libusb-devel |
-----------------------------------+-----------------------
Comment (by ballapete):
Replying to [comment:10 kencu]:
With this change `libusb @1.0.24` built:
{{{
Making all in libusb
make[2]: Entering directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libusb/libusb/work
/libusb-libusb-c6a35c5/libusb'
depbase=`echo os/darwin_usb.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ../libtool --tag=CC --mode=compile /opt/local/bin/gcc-
mp-7 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -std=gnu11 -Wall
-Wextra -Wshadow -Wunused -Wwrite-strings -Werror=format-security -Werror
=implicit-function-declaration -Werror=implicit-int -Werror=init-self
-Werror=missing-prototypes -Werror=strict-prototypes -Werror=undef
-Werror=uninitialized -fvisibility=hidden -pthread -pipe -Os -arch ppc -MT
os/darwin_usb.lo -MD -MP -MF $depbase.Tpo -c -o os/darwin_usb.lo
os/darwin_usb.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I..
-I/opt/local/include -std=gnu11 -Wall -Wextra -Wshadow -Wunused -Wwrite-
strings -Werror=format-security -Werror=implicit-function-declaration
-Werror=implicit-int -Werror=init-self -Werror=missing-prototypes -Werror
=strict-prototypes -Werror=undef -Werror=uninitialized -fvisibility=hidden
-pthread -pipe -Os -arch ppc -MT os/darwin_usb.lo -MD -MP -MF
os/.deps/darwin_usb.Tpo -c os/darwin_usb.c -fno-common -DPIC -o
os/.libs/darwin_usb.o
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
os/darwin_usb.c:1070:63: warning: '%02x' directive output may be truncated
writing 2 bytes into a region of size between 1 and 3 [-Wformat-
truncation=]
snprintf(new_device->sys_path, 20, "%03i-%04x-%04x-%02x-%02x",
new_device->address,
^~~~
os/darwin_usb.c:1070:42: note: directive argument in the range [0, 255]
snprintf(new_device->sys_path, 20, "%03i-%04x-%04x-%02x-%02x",
new_device->address,
^~~~~~~~~~~~~~~~~~~~~~~~~~
os/darwin_usb.c:1070:7: note: 'snprintf' output between 20 and 22 bytes
into a destination of size 20
snprintf(new_device->sys_path, 20, "%03i-%04x-%04x-%02x-%02x",
new_device->address,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libusb_le16_to_cpu (new_device->dev_descriptor.idVendor),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libusb_le16_to_cpu (new_device->dev_descriptor.idProduct),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_device->dev_descriptor.bDeviceClass,
new_device->dev_descriptor.bDeviceSubClass);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile: /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I..
-I/opt/local/include -std=gnu11 -Wall -Wextra -Wshadow -Wunused -Wwrite-
strings -Werror=format-security -Werror=implicit-function-declaration
-Werror=implicit-int -Werror=init-self -Werror=missing-prototypes -Werror
=strict-prototypes -Werror=undef -Werror=uninitialized -fvisibility=hidden
-pthread -pipe -Os -arch ppc -MT os/darwin_usb.lo -MD -MP -MF
os/.deps/darwin_usb.Tpo -c os/darwin_usb.c -o os/darwin_usb.o >/dev/null
2>&1
/bin/sh ../libtool --tag=CC --mode=link /opt/local/bin/gcc-mp-7
-std=gnu11 -Wall -Wextra -Wshadow -Wunused -Wwrite-strings -Werror
=format-security -Werror=implicit-function-declaration -Werror=implicit-
int -Werror=init-self -Werror=missing-prototypes -Werror=strict-prototypes
-Werror=undef -Werror=uninitialized -fvisibility=hidden -pthread -pipe -Os
-arch ppc -version-info 3:0:3 -no-undefined -L/opt/local/lib
-Wl,-headerpad_max_install_names -arch ppc -o libusb-1.0.la -rpath
/opt/local/lib core.lo descriptor.lo hotplug.lo io.lo strerror.lo sync.lo
os/events_posix.lo os/threads_posix.lo os/darwin_usb.lo -lobjc
-Wl,-framework,IOKit -Wl,-framework,CoreFoundation
libtool: link: /opt/local/bin/gcc-mp-7 -dynamiclib -o
.libs/libusb-1.0.0.dylib .libs/core.o .libs/descriptor.o .libs/hotplug.o
.libs/io.o .libs/strerror.o .libs/sync.o os/.libs/events_posix.o
os/.libs/threads_posix.o os/.libs/darwin_usb.o -L/opt/local/lib -lobjc
-pthread -Os -arch ppc -Wl,-headerpad_max_install_names -arch ppc
-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -pthread
-install_name /opt/local/lib/libusb-1.0.0.dylib -compatibility_version 4
-current_version 4.0 -Wl,-single_module
libtool: link: (cd ".libs" && rm -f "libusb-1.0.dylib" && ln -s
"libusb-1.0.0.dylib" "libusb-1.0.dylib")
libtool: link: ar cru .libs/libusb-1.0.a core.o descriptor.o hotplug.o
io.o strerror.o sync.o os/events_posix.o os/threads_posix.o
os/darwin_usb.o
libtool: link: ranlib .libs/libusb-1.0.a
libtool: link: ( cd ".libs" && rm -f "libusb-1.0.la" && ln -s
"../libusb-1.0.la" "libusb-1.0.la" )
make[2]: Leaving directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libusb/libusb/work
/libusb-libusb-c6a35c5/libusb'
}}}
--
Ticket URL: <https://trac.macports.org/ticket/61868#comment:31>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list