[pushed] fbsd-nat: Fix build failure with GCC 12

Message ID OS3P286MB21524C02409456C2B954D41AF0C3A@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM
State New
Headers
Series [pushed] fbsd-nat: Fix build failure with GCC 12 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_check--master-arm warning Patch is already merged

Commit Message

Enze Li Sept. 26, 2023, 1:20 p.m. UTC
  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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

John Baldwin Sept. 26, 2023, 3:58 p.m. UTC | #1
On 9/26/23 2:20 PM, Enze Li wrote:
> 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 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
> index 81a77b3a60f..55a36f24025 100644
> --- a/gdb/fbsd-nat.c
> +++ b/gdb/fbsd-nat.c
> @@ -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;

Thanks, but odd as I had fixed that locally and thought I had pushed that
version with this fix. :-/  Not sure why I pushed the old version.
  

Patch

diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 81a77b3a60f..55a36f24025 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -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;