commit: 057e21919e19feb2fd4d51e2bf18d3c0b4512a61 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sun Feb 20 22:14:46 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Feb 20 23:08:37 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=057e2191
dev-libs/libusb: fix build failure with -O3 Upstream patch (not yet merged, but simple enough) which works around a build failure (false positive) with -O3. Closes: https://bugs.gentoo.org/832732 Signed-off-by: Sam James <sam <AT> gentoo.org> .../files/libusb-1.0.25-fix-O3-warning.patch | 32 ++++++++++++++++++++++ dev-libs/libusb/libusb-1.0.25.ebuild | 4 +++ 2 files changed, 36 insertions(+) diff --git a/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch b/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch new file mode 100644 index 000000000000..7270b057d172 --- /dev/null +++ b/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch @@ -0,0 +1,32 @@ +https://github.com/libusb/libusb/pull/1062 +https://github.com/libusb/libusb/issues/1063 +https://bugs.gentoo.org/832732 + +From 8bb81fe72286cdcb782c7af4f0d7ef715b2e137c Mon Sep 17 00:00:00 2001 +From: Yegor Yefremov <yegorsli...@googlemail.com> +Date: Sun, 6 Feb 2022 07:12:14 +0100 +Subject: [PATCH] linux_usbfs: fix maybe-uninitialized error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Initialize active_config to an invalid value to avoid the following +compilation error: + +os/linux_usbfs.c: In function ‘op_get_configuration’: +os/linux_usbfs.c:1452:12: error: ‘active_config’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 1452 | *config = (uint8_t)active_config; + +Signed-off-by: Yegor Yefremov <yegorsli...@googlemail.com> +--- a/libusb/os/linux_usbfs.c ++++ b/libusb/os/linux_usbfs.c +@@ -1429,7 +1429,7 @@ static int op_get_configuration(struct libusb_device_handle *handle, + uint8_t *config) + { + struct linux_device_priv *priv = usbi_get_device_priv(handle->dev); +- int active_config; ++ int active_config = -1; /* to please compiler */ + int r; + + if (priv->sysfs_dir) { + diff --git a/dev-libs/libusb/libusb-1.0.25.ebuild b/dev-libs/libusb/libusb-1.0.25.ebuild index 328fa227b1de..71c8364d0b70 100644 --- a/dev-libs/libusb/libusb-1.0.25.ebuild +++ b/dev-libs/libusb/libusb-1.0.25.ebuild @@ -21,6 +21,10 @@ DEPEND="${RDEPEND} !udev? ( virtual/os-headers )" BDEPEND="doc? ( app-doc/doxygen )" +PATCHES=( + "${FILESDIR}"/${P}-fix-O3-warning.patch +) + multilib_src_configure() { local myeconfargs=( $(use_enable static-libs static)