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

Bluetooth: ISO: Fix -Wsometimes-uninitialized warning #85188

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

thughes
Copy link
Contributor

@thughes thughes commented Feb 4, 2025

Building sample.bluetooth.tmap_central with clang warns:

subsys/bluetooth/host/iso.c:2194:6: error: variable 'rsp' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2202:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2194:2: note: remove the 'if' if its condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2137:21: note: initialize the variable 'rsp' to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL
subsys/bluetooth/host/iso.c:2295:6: error: variable 'rsp' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2303:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2295:2: note: remove the 'if' if its condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2258:21: note: initialize the variable 'rsp' to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL

@thughes thughes marked this pull request as ready for review February 5, 2025 00:12
@zephyrbot zephyrbot added area: Bluetooth area: Bluetooth ISO Bluetooth LE Isochronous Channels labels Feb 5, 2025
Building sample.bluetooth.tmap_central with clang warns:

subsys/bluetooth/host/iso.c:2194:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2202:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2194:2: note: remove the 'if' if its
condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2137:21: note: initialize the variable 'rsp'
to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL
subsys/bluetooth/host/iso.c:2295:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2303:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2295:2: note: remove the 'if' if its
condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2258:21: note: initialize the variable 'rsp'
to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL

Signed-off-by: Tom Hughes <[email protected]>
@kartben kartben merged commit 14fe06e into zephyrproject-rtos:main Feb 8, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth ISO Bluetooth LE Isochronous Channels area: Bluetooth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants