Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/build] Fix cli/cli-style.c build error with C++20
Date: Wed, 12 Aug 2026 23:15:33 -0400	[thread overview]
Message-ID: <e37b1585-4d89-452d-825a-11e1ccac5902@simark.ca> (raw)
In-Reply-To: <20260813025445.237662-1-tdevries@suse.de>

On 8/12/26 10:54 PM, Tom de Vries wrote:
> PR build/34514 reports for a C++20 build:
> ...
> cli/cli-style.c:457:37: error: conversion from ‘const char8_t [8]’ to \
>   non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} \
>   requested
>   457 | static std::string warning_prefix = u8"\u26A0\uFE0F ";
>       |                                     ^~~~~~~~~~~~~~~~~
> ...
> 
> The u8 literal is char[] until C++20, but char8_t[] since C++20.
> 
> Fix this by using a reinterpret_cast<const char *>.
> 
> Tested by rebuilding using GCC 15.3.0, with and without -std=c++20.
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34514

Seems fine to me, I don't see a better way around it, other than moving
back to having the emoji in the code.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2026-08-13  3:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  2:54 Tom de Vries
2026-08-13  3:15 ` Simon Marchi [this message]
2026-08-13  4:34 ` Eli Zaretskii
2026-08-13 11:53   ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e37b1585-4d89-452d-825a-11e1ccac5902@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox