[Spice-devel] [PATCH spice-streaming-agent] test-stream-port: Remove warning compiling

Uri Lublin uril at redhat.com
Thu May 31 14:34:54 UTC 2018


Consider replacing "Remove warning compiling" with
e.g. "Remove unused variable 'buf'"

On 05/31/2018 12:38 PM, Frediano Ziglio wrote:
> This with gcc 8 causes:
> 
> test-stream-port.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____0()’:
> test-stream-port.cpp:78:18: error: unused variable ‘buf’ [-Werror=unused-variable]
>               char buf[10];
>                    ^~~
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Acked-by: Uri Lublin <uril at redhat.com>

Uri.

> ---
>   src/unittests/test-stream-port.cpp | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/src/unittests/test-stream-port.cpp b/src/unittests/test-stream-port.cpp
> index bb83447..e23a058 100644
> --- a/src/unittests/test-stream-port.cpp
> +++ b/src/unittests/test-stream-port.cpp
> @@ -75,7 +75,6 @@ SCENARIO("test basic IO on the stream port", "[port][io]") {
>           // - write() on the socketpair returns EPIPE, which throws WriteError
>           WHEN("closing the remote end and trying to write") {
>               ssa::write_all(fd[1], src_buf, src_size);
> -            char buf[10];
>               CHECK(close(fd[0]) == 0);
>               CHECK_THROWS_AS(ssa::write_all(fd[1], src_buf, src_size), ssa::WriteError);
>           }
> 



More information about the Spice-devel mailing list