diff mbox

[[PATCH,v2] ] libxl/arm: Fix ARM build.

Message ID 1494950273-5094-1-git-send-email-andrii.anisov@gmail.com
State New, archived
Headers show

Commit Message

Andrii Anisov May 16, 2017, 3:57 p.m. UTC
From: Andrii Anisov <andrii_anisov@epam.com>

Initialise *size in default branch to prevent certain compilers (i.e.
Linaro GCC 5.2-2015.11-2) from reporting "variable may be used uninitialized"
errors in caller function.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 tools/libxl/libxl_arm_acpi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Wei Liu May 16, 2017, 4:02 p.m. UTC | #1
On Tue, May 16, 2017 at 06:57:53PM +0300, Andrii Anisov wrote:
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> Initialise *size in default branch to prevent certain compilers (i.e.
> Linaro GCC 5.2-2015.11-2) from reporting "variable may be used uninitialized"
> errors in caller function.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
Julien Grall May 17, 2017, 2:36 p.m. UTC | #2
Hi,

On 16/05/17 17:02, Wei Liu wrote:
> On Tue, May 16, 2017 at 06:57:53PM +0300, Andrii Anisov wrote:
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>> Initialise *size in default branch to prevent certain compilers (i.e.
>> Linaro GCC 5.2-2015.11-2) from reporting "variable may be used uninitialized"
>> errors in caller function.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,
diff mbox

Patch

diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c
index db113db..a6456be 100644
--- a/tools/libxl/libxl_arm_acpi.c
+++ b/tools/libxl/libxl_arm_acpi.c
@@ -87,6 +87,7 @@  static int libxl__estimate_madt_size(libxl__gc *gc,
         break;
     default:
         LOG(ERROR, "Unknown GIC version");
+        *size = 0;
         rc = ERROR_FAIL;
         break;
     }