From nobody Tue Dec 24 16:15:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1512488883426450.41844002961955; Tue, 5 Dec 2017 07:48:03 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 365032034A763; Tue, 5 Dec 2017 07:43:31 -0800 (PST) Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E9D5A20356240 for ; Tue, 5 Dec 2017 07:43:29 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id q9so783300wre.7 for ; Tue, 05 Dec 2017 07:48:00 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id k11sm842459wmi.18.2017.12.05.07.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 07:47:57 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GX6MgJCWRSQFgtfR9Hpph67SbmkN/xp6TU3jMaJxqLw=; b=fCIcnqIyu7swVSeI8aIh2itHYf+wlLj7lV1+id6CYGiFMgQ480XPkrUDGoDHMVfQWE mj0lN8rxd/sNnRVBzUiuvFXM5vQ2x0fj6wS57AlX0xan9CksYwQStOTixhg7f7hWFvzx D2VkE7RmQZb/DdWCiVV4BBzngpg+m+TPhcYwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GX6MgJCWRSQFgtfR9Hpph67SbmkN/xp6TU3jMaJxqLw=; b=VFPIwQu7Kw3EbEoHMfE3xDphveJiTXMgrs2h9lFBYVPv1eQ97L7eAAZ+IDSd5u/GHb UysI1KZnqfBX5x3snDHirCQgq+VprQjtOzJW9W6NBEJWVx51pSJrDsO9umnvJlZ5tXeC Kj3TB1thYz5dujC5ZIO5U9yc5CSx6LyJ170VZMMTtj0tYbEmDSiQwGyB84gM631Y6dC7 Yer9dmHVldSYsxwCh+KN5S1Vz2FCiu0OS3euaKlPiZB00GcvlLB/VyZWUoX0bN15TltZ 1FxKaZG9BENl2gzBLuOSl1DyUcSiZH9YKgXGb6c2XuOmqwD3Kv8+S4c7y3HbKU0hkr3m oJ4A== X-Gm-Message-State: AJaThX7TGKpic6q7xlqlwua3eh8xuwP2en2qUxAgSxYLfNc8u/EqN4o5 QcbaUugaaE9mx8muKdTl9TfINc1cK5g= X-Google-Smtp-Source: AGs4zMY8cmqVrWDqAqCvNvT0TqWpp8mQo0xv2jCTWsDHnAIKLp/HZy4Rr70O66cfY1zidVBS8G6bHw== X-Received: by 10.223.147.133 with SMTP id 5mr16275861wrp.230.1512488878777; Tue, 05 Dec 2017 07:47:58 -0800 (PST) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Tue, 5 Dec 2017 15:47:56 +0000 Message-Id: <20171205154756.12302-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] BaseTools: align ENCODE_ERROR macro with MdePkg version X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" BaseTools' BaseTypes.h defined the ENCODE_ERROR macro as whereas MdePkg defines it as When building with GCC 6.3 (at least) the former triggers "error: overflow in implicit constant conversion [-Werror=3Doverflow]" Resolve this by aligning it with the latter one. This also requires aligning the BaseTools typedef of RETURN_STATUS with the MdePkg one: INTN -> UINTN. Add an explicit initialization of *Alignment to 0 in GenFfs.c GetAlignmentFromFile to get rid of a warning occuring with GCC after this change (-Werror=3Dmaybe-uninitialized). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm --- BaseTools/Source/C/GenFfs/GenFfs.c | 1 + BaseTools/Source/C/Include/Common/BaseTypes.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs= /GenFfs.c index e2fb3e0d1e..3b4a9b7761 100644 --- a/BaseTools/Source/C/GenFfs/GenFfs.c +++ b/BaseTools/Source/C/GenFfs/GenFfs.c @@ -529,6 +529,7 @@ GetAlignmentFromFile(char *InFile, UINT32 *Alignment) =20 InFileHandle =3D NULL; PeFileBuffer =3D NULL; + *Alignment =3D 0; =20 memset (&ImageContext, 0, sizeof (ImageContext)); =20 diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h b/BaseTools/Sour= ce/C/Include/Common/BaseTypes.h index 198647ab95..5fa4e560d8 100644 --- a/BaseTools/Source/C/Include/Common/BaseTypes.h +++ b/BaseTools/Source/C/Include/Common/BaseTypes.h @@ -170,12 +170,12 @@ // EFI Error Codes common to all execution phases // =20 -typedef INTN RETURN_STATUS; +typedef UINTN RETURN_STATUS; =20 /// /// Set the upper bit to indicate EFI Error. /// -#define ENCODE_ERROR(a) (MAX_BIT | (a)) +#define ENCODE_ERROR(a) ((RETURN_STATUS)(MAX_BIT | (a))) =20 #define ENCODE_WARNING(a) (a) #define RETURN_ERROR(a) ((a) < 0) --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel