[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/9] linux-user: fix implicit conversion from enumeration type err
From: |
Laurent Vivier |
Subject: |
[PULL 1/9] linux-user: fix implicit conversion from enumeration type error |
Date: |
Thu, 3 Sep 2020 01:26:53 +0200 |
MK_ARRAY(type,size) is used to fill the field_types buffer, and if the
"size" parameter is an enum type, clang [-Werror,-Wenum-conversion] reports
an error when it is assigned to field_types which is also an enum, argtypes.
To avoid that, convert "size" to "int" in MK_ARRAY(). "int" is the type
used for the size evaluation in thunk_type_size().
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200902125752.1033524-1-laurent@vivier.eu>
---
include/exec/user/thunk.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index a5bbb2c73331..b281dfa30f8c 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -42,7 +42,7 @@ typedef enum argtype {
} argtype;
#define MK_PTR(type) TYPE_PTR, type
-#define MK_ARRAY(type, size) TYPE_ARRAY, size, type
+#define MK_ARRAY(type, size) TYPE_ARRAY, (int)(size), type
#define MK_STRUCT(id) TYPE_STRUCT, id
#define THUNK_TARGET 0
--
2.26.2
- [PULL 0/9] Linux user for 5.2 patches, Laurent Vivier, 2020/09/02
- [PULL 1/9] linux-user: fix implicit conversion from enumeration type error,
Laurent Vivier <=
- [PULL 4/9] linux-user: Add support for btrfs ioctls used to manipulate with devices, Laurent Vivier, 2020/09/02
- [PULL 2/9] linux-user: Add support for a group of btrfs ioctls used for subvolumes, Laurent Vivier, 2020/09/02
- [PULL 3/9] linux-user: Add support for a group of btrfs ioctls used for snapshots, Laurent Vivier, 2020/09/02
- [PULL 6/9] linux-user: Add support for a group of btrfs inode ioctls, Laurent Vivier, 2020/09/02
- [PULL 7/9] linux-user: Add support for two btrfs ioctls used for subvolume, Laurent Vivier, 2020/09/02
- [PULL 9/9] linux-user: Add support for btrfs ioctls used to scrub a filesystem, Laurent Vivier, 2020/09/02
- [PULL 5/9] linux-user: Add support for btrfs ioctls used to get/set features, Laurent Vivier, 2020/09/02
- [PULL 8/9] linux-user: Add support for btrfs ioctls used to manage quota, Laurent Vivier, 2020/09/02
- Re: [PULL 0/9] Linux user for 5.2 patches, Peter Maydell, 2020/09/04