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

Compiler warnings: variable length array #163

Closed
rmlearney opened this issue Mar 9, 2021 · 1 comment
Closed

Compiler warnings: variable length array #163

rmlearney opened this issue Mar 9, 2021 · 1 comment
Labels
conclusion: duplicate Has already been submitted type: imperfection Perceived defect in any part of project

Comments

@rmlearney
Copy link

Just to make sure these are noted down:

libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::handleNotify(uint16_t, const uint8_t*, int)':
libraries/ArduinoBLE/src/utility/ATT.cpp:522:39: warning: variable length array 'notification' is used [-Wvla]
     uint8_t notification[_peers[i].mtu];
                                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::handleInd(uint16_t, const uint8_t*, int)':
ArduinoBLE/src/utility/ATT.cpp:552:37: warning: variable length array 'indication' is used [-Wvla]
     uint8_t indication[_peers[i].mtu];
                                     ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::findInfoReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:675:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/HCI.cpp: In member function 'virtual int HCIClass::sendAclPkt(uint16_t, uint8_t, uint8_t, void*)':
libraries/ArduinoBLE/src/utility/HCI.cpp:430:41: warning: variable length array 'txBuffer' is used [-Wvla]
   uint8_t txBuffer[sizeof(aclHdr) + plen];
                                         ^
libraries/ArduinoBLE/src/utility/HCI.cpp: In member function 'virtual int HCIClass::sendCommand(uint16_t, uint8_t, void*)':
libraries/ArduinoBLE/src/utility/HCI.cpp:472:41: warning: variable length array 'txBuffer' is used [-Wvla]
   uint8_t txBuffer[sizeof(pktHdr) + plen];
                                         ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::findByTypeReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:767:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::readByGroupReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:817:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::readOrReadBlobReq(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:919:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::readByTypeReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1024:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::writeReqOrCmd(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1224:25: warning: variable length array 'response' is used [-Wvla]
     uint8_t response[mtu];
                         ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::prepWriteReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1310:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual void ATTClass::execWriteReq(uint16_t, uint16_t, uint8_t, uint8_t*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1343:23: warning: variable length array 'response' is used [-Wvla]
   uint8_t response[mtu];
                       ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::exchangeMtu(uint16_t)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1425:33: warning: variable length array 'responseBuffer' is used [-Wvla]
   uint8_t responseBuffer[_maxMtu];
                                 ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::discoverServices(uint16_t, BLERemoteDevice*, const char*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1439:33: warning: variable length array 'responseBuffer' is used [-Wvla]
   uint8_t responseBuffer[_maxMtu];
                                 ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::discoverCharacteristics(uint16_t, BLERemoteDevice*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1495:33: warning: variable length array 'responseBuffer' is used [-Wvla]
   uint8_t responseBuffer[_maxMtu];
                                 ^
libraries/ArduinoBLE/src/utility/ATT.cpp: In member function 'virtual bool ATTClass::discoverDescriptors(uint16_t, BLERemoteDevice*)':
libraries/ArduinoBLE/src/utility/ATT.cpp:1552:33: warning: variable length array 'responseBuffer' is used [-Wvla]
   uint8_t responseBuffer[_maxMtu];
                                 ^
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 9, 2021
@per1234
Copy link
Contributor

per1234 commented Mar 9, 2021

Hi @rmlearney. Thanks for taking the time to report this issue.

We already have a prior issue report about this at #89.

It's best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.
If you end up with additional information to share, feel free to comment in the other thread.

Regards, Per

@per1234 per1234 closed this as completed Mar 9, 2021
@per1234 per1234 added the conclusion: duplicate Has already been submitted label Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants