Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation error -Wshorten-64-to-32 in stlink-lib/usb.c #1427

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

jg1uaa
Copy link
Contributor

@jg1uaa jg1uaa commented Sep 16, 2024

I found the error on OpenBSD-7.5/amd64.

[ 28%] Building C object CMakeFiles/stlink-shared.dir/src/stlink-lib/usb.c.o
/home/uaa/z/stlink/src/stlink-lib/usb.c:1120:9: error: implicit conversion loses integer precision: 'unsigned long' to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
        return strlen(serial);
        ~~~~~~ ^~~~~~~~~~~~~~
1 error generated.
*** Error 1 in build/Release (CMakeFiles/stlink-shared.dir/build.make:258 'CMakeFiles/stlink-shared.dir/src/stlink-lib/usb.c.o': /usr/bin/cc...)
*** Error 2 in build/Release (CMakeFiles/Makefile2:238 'CMakeFiles/stlink-shared.dir/all': make -s -f CMakeFiles/stlink-shared.dir/build.mak...)
*** Error 2 in build/Release (Makefile:156 'all': make -s -f CMakeFiles/Makefile2 all)
*** Error 2 in /home/uaa/z/stlink (Makefile:34 'release': @make -C build/Release)
uaa@framboise:~/z/stlink$

@Nightwalker-87 Nightwalker-87 added this to the v1.8.1 milestone Oct 3, 2024
@Nightwalker-87 Nightwalker-87 changed the title stlink-lib/usb.c: fix -Wshorten-64-to-32 error Fixed compilation error -Wshorten-64-to-32 in stlink-lib/usb.c Oct 3, 2024
@Nightwalker-87 Nightwalker-87 merged commit 9f15769 into stlink-org:testing Oct 3, 2024
10 checks passed
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants