Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832732 - dev-libs/libusb-1.0.25 libusb/os/linux_usbfs.c:1452:19: error: 'active_config' may be used uninitialized in this function
Summary: dev-libs/libusb-1.0.25 libusb/os/linux_usbfs.c:1452:19: error: 'active_config...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://github.com/libusb/libusb/issu...
Whiteboard:
Keywords:
: 832998 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-05 02:12 UTC by rx80
Modified: 2022-02-20 23:11 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,30.86 KB, text/plain)
2022-02-05 02:15 UTC, rx80
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rx80 2022-02-05 02:12:35 UTC
fails to build with error:

/var/tmp/portage/dev-libs/libusb-1.0.25/work/libusb-1.0.25/libusb/os/linux_usbfs.c: In function 'op_get_configuration':
/var/tmp/portage/dev-libs/libusb-1.0.25/work/libusb-1.0.25/libusb/os/linux_usbfs.c:1452:19: error: 'active_config' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1452 |         *config = (uint8_t)active_config;
      |                   ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


Reproducible: Always
Comment 1 rx80 2022-02-05 02:15:44 UTC
Created attachment 764365 [details]
build.log
Comment 2 rx80 2022-02-05 02:16:45 UTC
Build works fine with ABI_X86="64"
Fails with ABI_X86="32 64"
Comment 3 Jonas Stein gentoo-dev 2022-02-05 20:09:48 UTC
Please
* paste the emerge info 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Comment 4 rx80 2022-02-05 20:27:12 UTC
After further investigation, it turns out that changing CFLAGS -O3 to -O2 "fixes" it. Please close this bug if this is an unsupported configuration.
Comment 5 Mike Gilbert gentoo-dev 2022-02-07 00:58:20 UTC
Please report the issue upstream.

https://github.com/libusb/libusb/issues
Comment 6 Mike Gilbert gentoo-dev 2022-02-09 16:34:01 UTC
*** Bug 832998 has been marked as a duplicate of this bug. ***
Comment 7 Maciej S. Szmigiero 2022-02-20 17:50:06 UTC
Upstream PR at https://github.com/libusb/libusb/pull/1062 fixes the issue for me.

Maybe we should include this trivial patch in dev-libs/libusb ebuild to prevent user's @world updates from failing?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-20 19:18:28 UTC
(In reply to Maciej S. Szmigiero from comment #7)
> Upstream PR at https://github.com/libusb/libusb/pull/1062 fixes the issue
> for me.
> 
> Maybe we should include this trivial patch in dev-libs/libusb ebuild to
> prevent user's @world updates from failing?

Nobody is making folks use -O3 but yes, sure, I was just waiting for it to be merged, but it is indeed simple. I'll add it in a bit.
Comment 9 Larry the Git Cow gentoo-dev 2022-02-20 23:11:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=057e21919e19feb2fd4d51e2bf18d3c0b4512a61

commit 057e21919e19feb2fd4d51e2bf18d3c0b4512a61
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-02-20 22:14:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-02-20 23:08:37 +0000

    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@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(+)