]>
git.feebdaed.xyz Git - 0xmirror/binutils-gdb.git/commit
[gdb/build, c++20] Fix UTF-8 string literal usage
PR build/33675 reports a build breaker:
...
top.c: In function ‘void box_one_message(ui_file*, std::string, int)’:
top.c:1368:35: error: conditional expression between distinct pointer types \
‘const char8_t*’ and ‘const char*’ lacks a cast
1368 | const char *wall = emojis_ok () ? u8"\u2503" : "|";
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
...
The problem is that UTF-8 string literals have type:
- const char[N] (until C++20), or
- const char8_t[N] (since C++20)
Fix this by assigning to variables:
...
static const char bd_heavy_vertical[] = u8"\u2503";
...
and using the variables instead.
Tested by rebuilding on x86_64-linux, and starting gdb and checking the
welcome message box.
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33675