qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
Date: Fri, 10 Jun 2022 16:04:39 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 5/6/22 17:19, Bernhard Beschow wrote:
Fixes compilation due to false positives with -Werror:

   In file included from /usr/include/glib-2.0/glib.h:114,
                    from qemu/src/include/glib-compat.h:32,
                    from qemu/src/include/qemu/osdep.h:144,
                    from ../src/hw/mips/boston.c:20:
   In function ‘g_autoptr_cleanup_generic_gfree’,
       inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
   /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ 
may be used uninitialized [-Werror=maybe-uninitialized]
      28 |   g_free (*pp);
         |   ^~~~~~~~~~~~
   ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
   ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
     790 |             g_autofree const void *dtb_file_data, *dtb_load_data;
         |                                                    ^~~~~~~~~~~~~
   In function ‘g_autoptr_cleanup_generic_gfree’,
     inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
   /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ 
may be used uninitialized [-Werror=maybe-uninitialized]
      28 |   g_free (*pp);
         |   ^~~~~~~~~~~~
   ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
   ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
     790 |             g_autofree const void *dtb_file_data, *dtb_load_data;
         |                                    ^~~~~~~~~~~~~
   cc1: all warnings being treated as errors

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
  hw/mips/boston.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

Queued via mips-next.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]