Blame 0001-linux-user-fix-implicit-conversion-from-enumeration-.patch

Daniel P. Berrangé dc03f3
From 44716867275c9a5cdead2d70e6187b5af4087f07 Mon Sep 17 00:00:00 2001
Daniel P. Berrangé dc03f3
From: Laurent Vivier <laurent@vivier.eu>
Daniel P. Berrangé dc03f3
Date: Thu, 3 Sep 2020 01:26:53 +0200
Daniel P. Berrangé dc03f3
Subject: [PATCH 1/9] linux-user: fix implicit conversion from enumeration type
Daniel P. Berrangé dc03f3
 error
Daniel P. Berrangé dc03f3
Daniel P. Berrangé dc03f3
MK_ARRAY(type,size) is used to fill the field_types buffer, and if the
Daniel P. Berrangé dc03f3
"size" parameter is an enum type, clang [-Werror,-Wenum-conversion] reports
Daniel P. Berrangé dc03f3
an error when it is assigned to field_types which is also an enum, argtypes.
Daniel P. Berrangé dc03f3
Daniel P. Berrangé dc03f3
To avoid that, convert "size" to "int" in MK_ARRAY(). "int" is the type
Daniel P. Berrangé dc03f3
used for the size evaluation in thunk_type_size().
Daniel P. Berrangé dc03f3
Daniel P. Berrangé dc03f3
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Daniel P. Berrangé dc03f3
Message-Id: <20200902125752.1033524-1-laurent@vivier.eu>
Daniel P. Berrangé dc03f3
---
Daniel P. Berrangé dc03f3
 include/exec/user/thunk.h | 2 +-
Daniel P. Berrangé dc03f3
 1 file changed, 1 insertion(+), 1 deletion(-)
Daniel P. Berrangé dc03f3
Daniel P. Berrangé dc03f3
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
Daniel P. Berrangé dc03f3
index 7992475c9f..2099482cff 100644
Daniel P. Berrangé dc03f3
--- a/include/exec/user/thunk.h
Daniel P. Berrangé dc03f3
+++ b/include/exec/user/thunk.h
Daniel P. Berrangé dc03f3
@@ -42,7 +42,7 @@ typedef enum argtype {
Daniel P. Berrangé dc03f3
 } argtype;
Daniel P. Berrangé dc03f3
 
Daniel P. Berrangé dc03f3
 #define MK_PTR(type) TYPE_PTR, type
Daniel P. Berrangé dc03f3
-#define MK_ARRAY(type, size) TYPE_ARRAY, size, type
Daniel P. Berrangé dc03f3
+#define MK_ARRAY(type, size) TYPE_ARRAY, (int)(size), type
Daniel P. Berrangé dc03f3
 #define MK_STRUCT(id) TYPE_STRUCT, id
Daniel P. Berrangé dc03f3
 
Daniel P. Berrangé dc03f3
 #define THUNK_TARGET 0
Daniel P. Berrangé dc03f3
-- 
Daniel P. Berrangé dc03f3
2.26.2
Daniel P. Berrangé dc03f3