test: byte-stream-buffer: Initialize data array
Fix compiler warning about variable use before being initialized that appears with gcc 11.1.0. test/byte-stream-buffer.cpp:31:63: error: ‘data’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
139d885574
commit
017f629fc7
1 changed files with 6 additions and 1 deletions
|
@ -20,7 +20,12 @@ class ByteStreamBufferTest : public Test
|
||||||
protected:
|
protected:
|
||||||
int run()
|
int run()
|
||||||
{
|
{
|
||||||
std::array<uint8_t, 100> data;
|
/*
|
||||||
|
* gcc 11.1.0 incorrectly raises a maybe-uninitialized warning
|
||||||
|
* when calling data.size() below (if the address sanitizer is
|
||||||
|
* disabled). Silence it by initializing the array.
|
||||||
|
*/
|
||||||
|
std::array<uint8_t, 100> data = {};
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue