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

Fix uninitialized memory compile warning #17

Open
dalehumby opened this issue Feb 15, 2022 · 1 comment
Open

Fix uninitialized memory compile warning #17

dalehumby opened this issue Feb 15, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dalehumby
Copy link
Owner

Fix the warning

Compiling .pioenvs/lounge/src/main.cpp.o
lounge.yaml: In static member function 'static void std::_Function_handler<void(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Functor = setup()::<lambda(const esphome::esp32_ble_tracker::ESPBTDevice&)>; _ArgTypes = {const esphome::esp32_ble_tracker::ESPBTDevice&}]':
lounge.yaml:69:40: warning: '*((void*)& best_rssi +2)' may be used uninitialized in this function [-Wmaybe-uninitialized]
lounge.yaml:49:25: note: '*((void*)& best_rssi +2)' was declared here

This doesn't appear to be a problem? But should still be fixed.

@dalehumby dalehumby self-assigned this Feb 15, 2022
@dalehumby dalehumby added the bug Something isn't working label Feb 15, 2022
@ZacTyAdams
Copy link

This does appear to stop the build from completing as of 4.4.2023

/config/esphome/esp32-bluetooth-proxy-69cd88.yaml: In static member function 'static void std::_Function_handler<void(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Functor = setup()::<lambda(const esphome::esp32_ble_tracker::ESPBTDevice&)>; _ArgTypes = {const esphome::esp32_ble_tracker::ESPBTDevice&}]':
/config/esphome/esp32-bluetooth-proxy-69cd88.yaml:51:40: error: '*((void*)& best_rssi +2)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             id(apple_watch_rssi).publish_state(*best_rssi);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/config/esphome/esp32-bluetooth-proxy-69cd88.yaml:31:25: note: '*((void*)& best_rssi +2)' was declared here
           optional<int16_t> best_rssi = nullopt;
                         ^~~~~~~~~
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_ble_storage.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_config.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_dev.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_dm.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_main.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_profile_queue.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_sec.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_sm.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_storage.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/core/btc_util.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/bta_av_co.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_control.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.o
cc1plus: some warnings being treated as errors
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/a2dp/btc_av.o
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.o
*** [/data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/src/main.o] Error 1
Compiling /data/esp32-bluetooth-proxy-69cd88/.pioenvs/esp32-bluetooth-proxy-69cd88/bt/host/bluedroid/btc/profile/std/avrc/bta_avrc_co.o
========================== [FAILED] Took 4.11 seconds ==========================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants