fbsd-nat: Fix build failure with GCC 12
authorEnze Li <enze.li@hotmail.com>
Tue, 26 Sep 2023 12:55:36 +0000 (20:55 +0800)
committerEnze Li <enze.li@hotmail.com>
Tue, 26 Sep 2023 13:19:07 +0000 (21:19 +0800)
A user pointed out that the build failed on FreeBSD/amd64 with my last
commit.  The problem is that I'm not using the proper way to tell the
compiler that the variable has been "used".  This patch fixes this issue
as suggested by John.  Pushed as obvious.

Tested both on FreeBSD/amd64 and FreeBSD/aarch64 by rebuilding.

Suggested-By: John Baldwin <jhb@FreeBSD.org>
gdb/fbsd-nat.c

index 81a77b3a60fee90bb1293f13341f8c70f9f25c2b..55a36f240257e77e4ccae459315186bb52546010 100644 (file)
@@ -2094,7 +2094,7 @@ fbsd_nat_target::detach (inferior *inf, int from_tty)
                  }
 #else
                  /* pacify gcc  */
-                 wptid = (void) null_ptid;
+                 (void) wptid;
 #endif
                  sig = 0;
                  break;