]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
linux-user/hppa: fix -Werror=maybe-uninitialized false-positive
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 24 Sep 2024 11:43:56 +0000 (15:43 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 2 Oct 2024 12:14:29 +0000 (16:14 +0400)
../linux-user/hppa/cpu_loop.c: In function ‘hppa_lws’:
../linux-user/hppa/cpu_loop.c:106:17: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized]
  106 |     env->gr[28] = ret;

Add g_assert_not_reached() to help compiler, as suggested by Laurent.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
linux-user/hppa/cpu_loop.c

index bc093b8fe8b01963832aa5703254b4e3f374ceb4..23b38ff9b281c7b97ed37e226d9fc2b6da20e887 100644 (file)
@@ -99,6 +99,8 @@ static abi_ulong hppa_lws(CPUHPPAState *env)
 #endif
             }
             break;
+        default:
+            g_assert_not_reached();
         }
         break;
     }