On 17/01/21 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é <f4...@amsat.org>
---
v2: Remove pointless assert (Peter Maydell)

Yet another hole in our CI.

Supersedes: <20210117160754.4086411-1-f4...@amsat.org>
---
  softmmu/physmem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 6301f4f0a5c..cdcd197656f 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -605,7 +605,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
       * when the IOMMU tells us the mappings we've cached have changed.
       */
      MemoryRegion *mr = MEMORY_REGION(iommu_mr);
-    TCGIOMMUNotifier *notifier;
+    TCGIOMMUNotifier *notifier = NULL;
      int i;
for (i = 0; i < cpu->iommu_notifiers->len; i++) {


Queued, thanks.

Paolo


Reply via email to