You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-full-overlay/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warnin...

33 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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 <yegorslists@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 <yegorslists@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) {