All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH v2] softmmu/physmem: Silence GCC 10 maybe-uninitialized error
Date: Mon, 18 Jan 2021 08:26:54 +0100	[thread overview]
Message-ID: <5358e757-fa02-59d5-d1d1-81e5ea08e6a9@redhat.com> (raw)
In-Reply-To: <20210117170411.4106949-1-f4bug@amsat.org>

On 17/01/2021 18.04, Philippe Mathieu-Daudé wrote:
> When building with GCC 10.2 configured with --extra-cflags=-Os, we get:
> 
>    softmmu/physmem.c: In function ‘address_space_translate_for_iotlb’:
>    softmmu/physmem.c:643:26: error: ‘notifier’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      643 |         notifier->active = true;
>          |                          ^
>    softmmu/physmem.c:608:23: note: ‘notifier’ was declared here
>      608 |     TCGIOMMUNotifier *notifier;
>          |                       ^~~~~~~~
> 
> Initialize 'notifier' to silence the warning.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: Remove pointless assert (Peter Maydell)
> 
> Yet another hole in our CI.


I wouldn't call this a hole in the CI. AFAIU we don't support compiling with 
anything else than the default -O2 (and maybe -O0 for debugging?). -O3 is 
known to produce a lot of compiler warnings, and apparently -Os has such 
"problems", too. As far as I can see, it's a false positive warning here, 
"notifier" should always get initialized, the compiler just fails to see it 
correctly. Anyway, initializing the variable also can not hurt, so:

Reviewed-by: Thomas Huth <thuth@redhat.com>



      parent reply	other threads:[~2021-01-18  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 17:04 [PATCH v2] softmmu/physmem: Silence GCC 10 maybe-uninitialized error Philippe Mathieu-Daudé
2021-01-17 18:02 ` Paolo Bonzini
2021-01-18  7:26 ` Thomas Huth [this message]

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=5358e757-fa02-59d5-d1d1-81e5ea08e6a9@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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.