From ed0dcb1fd3356fa0c4ddef81eb395fbe27ec07a3 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 3 Aug 2021 18:13:41 -0400 Subject: [PATCH] gdb: fix warnings in bsd-kvm.c Building on OpenBSD, I get warnings like: CXX bsd-kvm.o /home/simark/src/binutils-gdb/gdb/bsd-kvm.c:241:18: error: ISO C++11 does not allow conversion from string literal to 'char *' [-Werror,-Wwritable-strings] nl[0].n_name = "_dumppcb"; ^ Silence those by adding casts. Change-Id: I2bef4eebcc306762a4e3e5b5c52f67ecf2820503 --- gdb/bsd-kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index d058aac39ec..5b414309f11 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -238,7 +238,7 @@ bsd_kvm_target::fetch_registers (struct regcache *regcache, int regnum) /* On dumping core, BSD kernels store the faulting context (PCB) in the variable "dumppcb". */ memset (nl, 0, sizeof nl); - nl[0].n_name = "_dumppcb"; + nl[0].n_name = (char *) "_dumppcb"; if (kvm_nlist (core_kd, nl) == -1) error (("%s"), kvm_geterr (core_kd)); @@ -256,7 +256,7 @@ bsd_kvm_target::fetch_registers (struct regcache *regcache, int regnum) "proc0paddr". */ memset (nl, 0, sizeof nl); - nl[0].n_name = "_proc0paddr"; + nl[0].n_name = (char *) "_proc0paddr"; if (kvm_nlist (core_kd, nl) == -1) error (("%s"), kvm_geterr (core_kd)); @@ -280,7 +280,7 @@ bsd_kvm_target::fetch_registers (struct regcache *regcache, int regnum) variable "thread0". */ memset (nl, 0, sizeof nl); - nl[0].n_name = "_thread0"; + nl[0].n_name = (char *) "_thread0"; if (kvm_nlist (core_kd, nl) == -1) error (("%s"), kvm_geterr (core_kd)); -- 2.30.2