[libcamera-devel] [PATCH] test: byte-stream-buffer: Initialize data array

Umang Jain umang.jain at ideasonboard.com
Sat May 22 18:32:34 CEST 2021


Hi Niklas,

Thank you for the patch.

On 5/22/21 8:51 PM, Niklas Söderlund wrote:
> 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 at ragnatech.se>
Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>   test/byte-stream-buffer.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/byte-stream-buffer.cpp b/test/byte-stream-buffer.cpp
> index d606f146f6ef04ed..c911a863d27122ae 100644
> --- a/test/byte-stream-buffer.cpp
> +++ b/test/byte-stream-buffer.cpp
> @@ -20,7 +20,7 @@ class ByteStreamBufferTest : public Test
>   protected:
>   	int run()
>   	{
> -		std::array<uint8_t, 100> data;
> +		std::array<uint8_t, 100> data = {};
>   		unsigned int i;
>   		uint32_t value;
>   		int ret;



More information about the libcamera-devel mailing list