ArduinoBLE icon indicating copy to clipboard operation
ArduinoBLE copied to clipboard

Warnings when compiling this code

Open roleroz opened this issue 1 year ago • 2 comments

When you build the code in this library there are several warnings printed

  • [x] ~~Order member initialization on BLELocalCharacteristic~~ (fixed by https://github.com/arduino-libraries/ArduinoBLE/pull/302)
  • [x] ~~Unused variables in:~~ (fixed by https://github.com/arduino-libraries/ArduinoBLE/pull/302)
    • [x] ~~HCIClass::tryResolveAddress~~
    • [x] ~~HCIClass::handleEventPkt (the whole else if statement did nothing)~~
    • [x] ~~L2CAPSignalingClass::handleSecurityData (one initialization should be inside of BLE_TRACE)~~
    • [x] ~~BluetoothCryptoToolbox::f5~~
    • [x] ~~BluetoothCryptoToolbox::testAh~~
    • [x] ~~BluetoothCryptoToolbox::testg2~~
  • [x] ~~Uninitialized variable in L2CAPSignalingClass::handleSecurityData~~ (fixed by https://github.com/arduino-libraries/ArduinoBLE/pull/302)
  • [ ] Unenumerated case in ArduinoBLE/src/utility/HCI.cpp
I have a PR ready for fixing most of these warnings (all except the last one) in https://github.com/arduino-libraries/ArduinoBLE/pull/302, but I haven't had luck getting any traction on getting that reviewed

If someone could review that PR most of these things would be fixed.

If someone tells me what 0x0A means in that unenumerated case, I'm happy to add that to the enum as well

Additional context

Additional reports

  • https://github.com/arduino-libraries/ArduinoBLE/issues/274
  • https://github.com/arduino-libraries/ArduinoBLE/issues/346

roleroz avatar Jul 20 '23 04:07 roleroz

This is still incomplete, there is also the unenumerated case in ArduinoBLE/src/utility/HCI.cpp, if someone can tell me what does 0x0A means in that file, I'll create a PR for it

roleroz avatar Aug 04 '23 19:08 roleroz

Issue "Unenumerated case in ArduinoBLE/src/utility/HCI.cpp" not fixed . Depending on the Preferences "Compiler warnings" set to All or More there is an error message:

f:\Projects\Arduino\libraries\ArduinoBLE\src\utility\HCI.cpp: In member function 'virtual void HCIClass::handleEventPkt(uint8_t, uint8_t*)':
f:\Projects\Arduino\libraries\ArduinoBLE\src\utility\HCI.cpp:991:7: error: case value '10' not in enumerated type 'LE_META_EVENT' [-Werror=switch]
       case 0x0A:{
       ^~~~
cc1plus.exe: some warnings being treated as errors

ataweg avatar Jan 17 '24 13:01 ataweg