[PATCH 1/3] tests/qtest/vnc-display-test: Suppress build warnings on Windows

Philippe Mathieu-Daudé posted 3 patches 2 years, 11 months ago
Maintainers: Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 1/3] tests/qtest/vnc-display-test: Suppress build warnings on Windows
Posted by Philippe Mathieu-Daudé 2 years, 11 months ago
While this test is skipped on Windows, we still get when building:

  tests/qtest/vnc-display-test.c:22:20: warning: unused function 'on_vnc_error' [-Wunused-function]
  static inline void on_vnc_error(VncConnection* self,
                     ^
  tests/qtest/vnc-display-test.c:28:20: warning: unused function 'on_vnc_auth_failure' [-Wunused-function]
  static inline void on_vnc_auth_failure(VncConnection *self,
                     ^
  2 warnings generated.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/vnc-display-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c
index e2a9d682bb..fd63e3a881 100644
--- a/tests/qtest/vnc-display-test.c
+++ b/tests/qtest/vnc-display-test.c
@@ -19,6 +19,8 @@ typedef struct Test {
     GMainLoop *loop;
 } Test;
 
+#if !defined(WIN32)
+
 static void on_vnc_error(VncConnection* self,
                          const char* msg)
 {
@@ -31,6 +33,8 @@ static void on_vnc_auth_failure(VncConnection *self,
     g_error("vnc-auth-failure: %s", msg);
 }
 
+#endif
+
 static bool
 test_setup(Test *test)
 {
-- 
2.38.1


Re: [PATCH 1/3] tests/qtest/vnc-display-test: Suppress build warnings on Windows
Posted by Richard Henderson 2 years, 11 months ago
On 1/19/23 02:05, Philippe Mathieu-Daudé wrote:
> While this test is skipped on Windows, we still get when building:
> 
>    tests/qtest/vnc-display-test.c:22:20: warning: unused function 'on_vnc_error' [-Wunused-function]
>    static inline void on_vnc_error(VncConnection* self,
>                       ^
>    tests/qtest/vnc-display-test.c:28:20: warning: unused function 'on_vnc_auth_failure' [-Wunused-function]
>    static inline void on_vnc_auth_failure(VncConnection *self,
>                       ^
>    2 warnings generated.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   tests/qtest/vnc-display-test.c | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~