[PATCH 5/7] [gdb/build, c++20] Fix invalid conversion in test_symbols

Tom de Vries tdevries@suse.de
Tue Aug 15 18:13:07 GMT 2023


When building gdb with -std=c++20, I run into:
...
gdb/dwarf2/read.c:2709:3: error: invalid conversion from ‘const char8_t*’ to \
  ‘const char*’ [-fpermissive]
 2709 |   u8"u8função",
      |   ^~~~~~~~~~~~
      |   |
      |   const char8_t*
...

Fix this by making the conversion explicit.

Tested on x86_64-linux.
---
 gdb/dwarf2/read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index a64f82bd24a..5b13bbda31d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2706,7 +2706,7 @@ static const char *test_symbols[] = {
   /* A UTF-8 name with multi-byte sequences to make sure that
      cp-name-parser understands this as a single identifier ("função"
      is "function" in PT).  */
-  u8"u8função",
+  (const char *)u8"u8função",
 
   /* Test a symbol name that ends with a 0xff character, which is a
      valid character in non-UTF-8 source character sets (e.g. Latin1
-- 
2.35.3



More information about the Gdb-patches mailing list