From patchwork Tue Sep 1 15:33:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1355240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BgsSk6c77z9shl for ; Wed, 2 Sep 2020 02:08:54 +1000 (AEST) Received: from localhost ([::1]:38478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD8q4-0005GJ-A2 for incoming@patchwork.ozlabs.org; Tue, 01 Sep 2020 12:08:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD8Hv-0003yL-JS for qemu-devel@nongnu.org; Tue, 01 Sep 2020 11:33:35 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:45941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD8Ht-0008UR-Tu for qemu-devel@nongnu.org; Tue, 01 Sep 2020 11:33:35 -0400 Received: from localhost.localdomain ([82.252.135.186]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MdwRi-1kkp920jWI-00b5nn; Tue, 01 Sep 2020 17:33:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH] linux-user: fix implicit conversion from enumeration type error Date: Tue, 1 Sep 2020 17:33:21 +0200 Message-Id: <20200901153321.920490-1-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:t7fLNYjmVWVsgcmOTqVx4r3QPEP4kaIRaNw9xN6EIFmSHG7iR9P W4Ub5il91XLJYPGE4Eeawqy/CWyKQgss5X+3XnKjSGCjB3vl/KM2CBsxpw8aE3zk4EymJGv Doh3p3I0kEQh7aXwbdacnDPu+k0mM5b71ylyyuiyEOjn692mp+XGeiVDG1ffgT6TeVu6PiI 0ci/wk/LOVg1vaAcCnS2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:44/Vfp6phLY=:Zz1wh/nZdiMpnjhU5kWyGv FQgTT/eRNhxORP2Q0i0Dyb/iViOw74sVfds+rghUg6qiKs8peEM8+EUkn3C6Pme94ehy7RkmM x/BI6Zb+PglHR3HuKZJl9Gx/YIwBu8QvxhK5CSA+9uFij7fN8ATou9qrU+f0HwxQDQgm6fMDh WPsJcraaHMj9zLTiA3Mqc59jqjCxOX790piUxDaeGqMKmEXR9eGxvR3ZvYc4dO/BPMcmVKRTl 3lc6kSIm+Ima5fcbz/7oLDt/Hj1NHK11m3qTO2pLJ75zZeJwXSElnT9PRfirqyepLGPdpCQP3 Dvq6XyavGMjUXEO4xDAWy9m7QlFLPhEnV4+pfmM5i8YreKzefGt/DuDINg6VR0aLi6Ol17J39 Kn6+FHEpOqYop2QKr+7khQf8AC1kNrS5riLHpqa0Xhww7MX/HgXkKUogASf56r4oQBoi8miEc vh50DchrODrsbuCTssPN1MfovCyyc1dQ3VJC9O18wWl4Ct6w1Ak39rZ3+c30iWn/mxO2YXDYo iaQ0mglkb+u/eY/4n0T/JKvBikNLWZygkXXvQYugy07mpuxdWfs/U2yh9T9vTSYZnLEVnP9FO LfE8SKzlYVTCwvrj4ORMN7ZIGlvMYettRltDlTdIdYniHaU82pW6JO4I/8NTMr8HLslsy+3yh tHyljK5wDPZL/OhGAjLNQ/c7i0M73Vx1ZneUXRy/V+8zAAJjNVoOKvw5ltix6GZUQeRaAPzf6 BCn56uy4QwZsj+bj0qLrxxgli/w4V961wSk++HuWnCne/R2PlO9xfsX6qdV2TgashlmTfvC9C jzOcnF12HLUqGjuhIewBPBLoCkUJTPMAl4Rt1qLT4mkuqNpHIFCYuYCY2PX0aekBreGGj0E Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/01 10:10:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Filip Bozuta Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé --- 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..b798fcb69cf4 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