All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: qemu-devel@nongnu.org,  Mahmoud Mandour <ma.mandourr@gmail.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	 Richard Henderson <richard.henderson@linaro.org>,
	 Alexandre Iooss <erdnaxe@crans.org>
Subject: Re: [PATCH v2 14/14] contrib/plugins/execlog: fix new warnings
Date: Fri, 26 Jan 2024 16:31:43 +0000	[thread overview]
Message-ID: <87msssqcnk.fsf@draig.linaro.org> (raw)
In-Reply-To: <20240118032400.3762658-15-pierrick.bouvier@linaro.org> (Pierrick Bouvier's message of "Thu, 18 Jan 2024 07:23:59 +0400")

Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:

> ‘g_pattern_match_string’ is deprecated,
> Use 'g_pattern_spec_match_string' instead.

Unfortunately this isn't enough as we can still build on older glibs:

  /* Ask for warnings for anything that was marked deprecated in
   * the defined version, or before. It is a candidate for rewrite.
   */
  #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_56

You can do something like:

  /*
   * g_pattern_match_string has been deprecated in Glib since 2.70 and
   * will complain about it if you try to use it. Fortunately the
   * signature of both functions is the same making it easy to work
   * around.
   */
  static inline
  gboolean g_pattern_spec_match_string_qemu(GPatternSpec *pspec,
                                            const gchar *string)
  {
  #if GLIB_CHECK_VERSION(2, 70, 0)
      return g_pattern_spec_match_string(pspec, string);
  #else
      return g_pattern_match_string(pspec, string);
  #endif
  };
  #define g_pattern_spec_match_string(p, s) g_pattern_spec_match_string_qemu(p, s)

in glib-compat.h but I was wondering if it would be valid to add that
dependency to plugins. We might get away with it as it doesn't include
anything from QEMU itself.

>
> passing argument 2 of ‘g_ptr_array_add’ discards ‘const’ qualifier from
> pointer target type
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>  contrib/plugins/execlog.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
> index 5a4de1c93be..d12137ce5c0 100644
> --- a/contrib/plugins/execlog.c
> +++ b/contrib/plugins/execlog.c
> @@ -336,8 +336,8 @@ static void registers_init(int vcpu_index)
>              for (int p = 0; p < rmatches->len; p++) {
>                  g_autoptr(GPatternSpec) pat = g_pattern_spec_new(rmatches->pdata[p]);
>                  g_autofree gchar *rd_lower = g_utf8_strdown(rd->name, -1);
> -                if (g_pattern_match_string(pat, rd->name) ||
> -                    g_pattern_match_string(pat, rd_lower)) {
> +                if (g_pattern_spec_match_string(pat, rd->name) ||
> +                    g_pattern_spec_match_string(pat, rd_lower)) {
>                      Register *reg = init_vcpu_register(vcpu_index, rd);
>                      g_ptr_array_add(registers, reg);
>  
> @@ -345,7 +345,7 @@ static void registers_init(int vcpu_index)
>                      if (disas_assist) {
>                          g_mutex_lock(&add_reg_name_lock);
>                          if (!g_ptr_array_find(all_reg_names, reg->name, NULL)) {
> -                            g_ptr_array_add(all_reg_names, reg->name);
> +                            g_ptr_array_add(all_reg_names, (gpointer)reg->name);
>                          }
>                          g_mutex_unlock(&add_reg_name_lock);
>                      }

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2024-01-26 16:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  3:23 [PATCH v2 00/14] TCG Plugin inline operation enhancement Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 01/14] plugins: implement inline operation relative to cpu_index Pierrick Bouvier
2024-01-26 12:07   ` Alex Bennée
2024-01-29 10:10     ` Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 02/14] plugins: scoreboard API Pierrick Bouvier
2024-01-26 15:14   ` Alex Bennée
2024-01-30  7:37     ` Pierrick Bouvier
2024-01-30 10:23       ` Alex Bennée
2024-01-30 11:10         ` Pierrick Bouvier
2024-01-31  7:44     ` Pierrick Bouvier
2024-02-01  5:28       ` Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 03/14] docs/devel: plugins can trigger a tb flush Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 04/14] plugins: add inline operation per vcpu Pierrick Bouvier
2024-01-26 15:17   ` Alex Bennée
2024-01-18  3:23 ` [PATCH v2 05/14] tests/plugin: add test plugin for inline operations Pierrick Bouvier
2024-01-26 16:05   ` Alex Bennée
2024-01-30  7:49     ` Pierrick Bouvier
2024-01-30 14:52       ` Alex Bennée
2024-01-30 16:40         ` Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 06/14] tests/plugin/mem: migrate to new per_vcpu API Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 07/14] tests/plugin/insn: " Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 08/14] tests/plugin/bb: " Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 09/14] contrib/plugins/hotblocks: " Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 10/14] contrib/plugins/howvec: " Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 11/14] plugins: remove non per_vcpu inline operation from API Pierrick Bouvier
2024-01-26 16:26   ` Alex Bennée
2024-01-30  7:53     ` Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 12/14] plugins: register inline op with a qemu_plugin_u64_t Pierrick Bouvier
2024-01-18  3:23 ` [PATCH v2 13/14] MAINTAINERS: Add myself as reviewer for TCG Plugins Pierrick Bouvier
2024-01-26 16:27   ` Alex Bennée
2024-01-18  3:23 ` [PATCH v2 14/14] contrib/plugins/execlog: fix new warnings Pierrick Bouvier
2024-01-26 16:31   ` Alex Bennée [this message]
2024-01-30  7:51     ` Pierrick Bouvier
2024-01-26  9:21 ` [PATCH v2 00/14] TCG Plugin inline operation enhancement Pierrick Bouvier

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=87msssqcnk.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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.