Commit bf8b14d
committed
Bluetooth: HFP_AG: Initialize variable to avoid warning
gcc 11.4.0, seems to be believe this variable may be used unitialized,
and warns about it (causing a test build failure due to warnings
being treated as errors).
Let's just initialize the variable to 0 to avoid the issue, as the
cost is trivial.
subsys/bluetooth/host/classic/hfp_ag.c: In function
‘bt_hfp_ag_vts_handler’:
1095
subsys/bluetooth/host/classic/hfp_ag.c:3091:17: error: ‘code’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
1096
3091 | bt_ag->transmit_dtmf_code(ag, code);
1097
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098
The issue can be reproduced for ex. with:
$ mkdir build ; cd build
$ cmake -GNinja -DBOARD=native_sim/native/64 ../tests/bluetooth/shell \
-DCONF_FILE="prj_br.conf"
$ ninja
Signed-off-by: Alberto Escolar Piedras <[email protected]>1 parent a1a92a2 commit bf8b14d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3062 | 3062 | | |
3063 | 3063 | | |
3064 | 3064 | | |
3065 | | - | |
| 3065 | + | |
3066 | 3066 | | |
3067 | 3067 | | |
3068 | 3068 | | |
| |||
0 commit comments