Re: [PATCH 3/3] scripts/qapi: pull c_name and lstrip from camel_to_upper to caller
Philippe Mathieu-Daudé <[email protected]> Mon, 3 Aug 2026 12:19:50 +0200
| Newsgroups | org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On 24/7/26 15:00, Paolo Bonzini wrote:
> Allow using camel_to_upper for other languages too.
>
> In particular, the lstrip() is needed to avoid reserved C identifiers,
> for example:
>
> typedef enum __org_qemu_x_Enum {
> __ORG_QEMU_X_ENUM___ORG_QEMU_X_VALUE,
> __ORG_QEMU_X_ENUM__MAX,
> } __org_qemu_x_Enum;
>
> Insulate Rust from this, since underscores have a different meaning
> in Rust (though only for the sake of warnings).
>
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
> scripts/qapi/common.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>