Linux CXL
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	qemu-block@nongnu.org, "Jonathan Cameron" <jic23@kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Roman Bolshakov" <rbolshakov@ddn.com>,
	"Phil Dennis-Jordan" <phil@philjordan.eu>,
	"Wei Liu" <wei.liu@kernel.org>,
	linux-cxl@vger.kernel.org,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Peter Xu" <peterx@redhat.com>, "Fabiano Rosas" <farosas@suse.de>
Subject: Re: [PATCH v2 07/12] Fix some -Werror=maybe-uninitialized
Date: Sun, 26 Jul 2026 16:52:30 -0400	[thread overview]
Message-ID: <20260726165049-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260727-fix2-v2-7-d0c4831ed7ea@redhat.com>

On Mon, Jul 27, 2026 at 12:44:06AM +0400, Marc-André Lureau wrote:
> When compiled with -Og, gcc produces many false-positives
> gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2).

it hurts if you do it? so don't do it then?

> We already use auto-var-init=zero, but better be explicit.

explicit about false positives?

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  target/i386/cpu.c             | 3 ++-
>  target/i386/emulate/x86_mmu.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 5805d33ab92d..28e4435df23f 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -7734,7 +7734,7 @@ static void x86_cpuid_get_avx10_version(Object *obj, Visitor *v,
>  static bool x86_cpu_apply_avx10_features(X86CPU *cpu, uint8_t version,
>                                           Error **errp)
>  {
> -    const AVX10VersionDefinition *def;
> +    const AVX10VersionDefinition *def = NULL;
>      CPUX86State *env = &cpu->env;
>  
>      if (!version) {
> @@ -7757,6 +7757,7 @@ static bool x86_cpu_apply_avx10_features(X86CPU *cpu, uint8_t version,
>              break;
>          }
>      }
> +    assert(def != NULL);
>  
>      if (def->version < version) {
>          error_setg(errp, "avx10-version can be at most %d", def->version);


what does assert have to do with gcc warnings?

> diff --git a/target/i386/emulate/x86_mmu.c b/target/i386/emulate/x86_mmu.c
> index 8d4371467fd7..65bcccd4751e 100644
> --- a/target/i386/emulate/x86_mmu.c
> +++ b/target/i386/emulate/x86_mmu.c
> @@ -185,8 +185,8 @@ static MMUTranslateResult walk_gpt(CPUState *cpu, target_ulong addr, MMUTranslat
>      int largeness = 0;
>      target_ulong cr3 = x86_read_cr(cpu, 3);
>      uint64_t page_mask = pae ? PAE_PTE_PAGE_MASK : LEGACY_PTE_PAGE_MASK;
> -    MMUTranslateResult res;
> -    
> +    MMUTranslateResult res = MMU_TRANSLATE_PAGE_NOT_MAPPED;
> +


This is not 0 as the commit log implies.



>      memset(pt, 0, sizeof(*pt));
>      top_level = gpt_top_level(cpu, pae);
>  
> 
> -- 
> 2.55.0


  reply	other threads:[~2026-07-26 20:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26 20:43 [PATCH v2 00/12] Fixes for 11.1 Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 01/12] hw/display/virtio-gpu-rutabaga: zero-init capset info response Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 02/12] block/blkio: fix error return value on getlength() Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 03/12] block/blkio: fix compiler false-positive warning Marc-André Lureau
2026-07-27  7:34   ` Philippe Mathieu-Daudé
2026-07-26 20:44 ` [PATCH v2 04/12] include/qemu: adjust LOCK_GUARD macros to avoid potential warning Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 05/12] hw/cxl: fix invalid free on early return Marc-André Lureau
2026-07-26 20:49   ` Michael S. Tsirkin
2026-07-26 21:09     ` Marc-André Lureau
2026-07-27  4:40       ` Akihiko Odaki
2026-07-27  7:35         ` Philippe Mathieu-Daudé
2026-07-27  8:30         ` Michael S. Tsirkin
2026-07-26 20:44 ` [PATCH v2 06/12] hw/i3c: fix default return value of d2_i3c_send() Marc-André Lureau
2026-07-27  7:40   ` Philippe Mathieu-Daudé
2026-07-26 20:44 ` [PATCH v2 07/12] Fix some -Werror=maybe-uninitialized Marc-André Lureau
2026-07-26 20:52   ` Michael S. Tsirkin [this message]
2026-07-26 21:07     ` Marc-André Lureau
2026-07-27  5:25       ` Akihiko Odaki
2026-07-27  8:56         ` Daniel P. Berrangé
2026-07-27  8:49       ` Michael S. Tsirkin
2026-07-26 20:44 ` [PATCH v2 08/12] hw/hexagon: fix machine->fdt leak in qom-test Marc-André Lureau
2026-07-27  7:21   ` Philippe Mathieu-Daudé
2026-07-26 20:44 ` [PATCH v2 09/12] hw/ppc: fix dangling fdt reference Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 10/12] hw/core/machine: free machine->fdt in machine_finalize() Marc-André Lureau
2026-07-26 20:44 ` [PATCH v2 11/12] migration/multifd: fix Error leak in multifd_recv_terminate_threads() Marc-André Lureau
2026-07-27 14:20   ` Fabiano Rosas
2026-07-27 14:24   ` Peter Xu
2026-07-26 20:44 ` [PATCH v2 12/12] qdev-monitor: drain RCU callbacks in qdev_device_add_from_qdict Marc-André Lureau
2026-07-26 20:49 ` [PATCH v2 00/12] Fixes for 11.1 Michael S. Tsirkin
2026-07-26 21:08   ` Marc-André Lureau
2026-07-27  8:51     ` Michael S. Tsirkin

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=20260726165049-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=fam@euphon.net \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=jic23@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=phil@philjordan.eu \
    --cc=philmd@mailo.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rbolshakov@ddn.com \
    --cc=stefanha@redhat.com \
    --cc=wei.liu@kernel.org \
    --cc=zhao1.liu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox