All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Michael Tokarev" <mjt@tls.msk.ru>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v4 3/4] qapi: Do not cast function pointers
Date: Tue, 28 May 2024 13:02:37 +0200	[thread overview]
Message-ID: <87r0dmw65u.fsf@pond.sub.org> (raw)
In-Reply-To: <20240524-xkb-v4-3-2de564e5c859@daynix.com> (Akihiko Odaki's message of "Fri, 24 May 2024 14:35:49 +0900")

Akihiko Odaki <akihiko.odaki@daynix.com> writes:

> -fsanitize=undefined complains if function pointers are casted. It
> also prevents enabling teh strict mode of CFI which is currently

Typo: the

> disabled with -fsanitize-cfi-icall-generalize-pointers.

The above describes the problem the patch solves.  Good!  Two
suggestions:

1. Quote the error message.

2. Briefly describe the solution as well.  Perhaps:

  The problematic casts are necessary to pass visit_type_T() and
  visit_type_T_members() as callbacks to qapi_clone() and
  qapi_clone_members(), respectively.  Open-code these two functions to
  avoid the callbacks, and thus the type casts.

> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2346
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>

Always kind of sad to move implementation code to headers, but getting
rid of the function pointer casts makes sense, and I don't have better
ideas for doing that.

With an improved commit message
Reviewed-by: Markus Armbruster <armbru@redhat.com>



  reply	other threads:[~2024-05-28 11:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24  5:35 [PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1 Akihiko Odaki
2024-05-24  5:35 ` [PATCH v4 1/4] qemu-keymap: Make references to allocations static Akihiko Odaki
2024-05-27  9:54   ` Philippe Mathieu-Daudé
2024-05-24  5:35 ` [PATCH v4 2/4] lockable: Do not cast function pointers Akihiko Odaki
2024-05-27  9:57   ` Philippe Mathieu-Daudé
2024-05-27 10:05     ` Philippe Mathieu-Daudé
2024-05-24  5:35 ` [PATCH v4 3/4] qapi: " Akihiko Odaki
2024-05-28 11:02   ` Markus Armbruster [this message]
2024-05-24  5:35 ` [PATCH v4 4/4] meson: Drop the .fa library suffix Akihiko Odaki
2024-05-29  7:39 ` [PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1 Thomas Huth

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=87r0dmw65u.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.