From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::242; helo=mail-io0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (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 A6726222EDCC4 for ; Tue, 2 Jan 2018 01:21:20 -0800 (PST) Received: by mail-io0-x242.google.com with SMTP id e20so5674750iof.12 for ; Tue, 02 Jan 2018 01:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TJGAoMxXYkh01Pp7copgi6YuFZgyli7m2p7Vml0xhlo=; b=FY6L31cdHL7kJf50+OAsqXnd0ni9JntMMxigW6Po2orLGMMNwRd/ojeJuoIBhRVi88 8uTQ2EQyZ2+SRcGeZEJdx5lZgItDkx278Voro4ccemC1d2O8+8iOheJfWJHu3o0wEOZI PNTo12hM/c/ovvXHWU6D2CcSEahkNGxuOzq9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TJGAoMxXYkh01Pp7copgi6YuFZgyli7m2p7Vml0xhlo=; b=nLgOGJAt+Xe3whsoqvwPB/d7V42agaT0Kw3Uz9lwop1cL5AoKgkQGXlTmCSt9TfDUd Ll6qV9sctobP8c7GuoLfvKK0qkMDsQfprPPYJ0D41dILwnuDeYrz1VHsxm3Or5xXfMua qJ4qRa/3h3PNPtclr4E1LvtLNKrJHoiOgWse9tQS8kXHyjhxh5zKCwJ15dCbaevIV157 qwuV9WQfqViJmhzaEHdUw4xyROyp3OlopwuWJUY9ow2ei4YLfmmGiccO6S7sVf8mLtYQ r+0L8StxSZ+IWmB6HdJts28kBvhnI02BLiZQqx8iRo2X0bSNITIQQEPrG+GWHY8GslD4 cKCQ== X-Gm-Message-State: AKGB3mIFZQFhfWIGmIWSlO6UH2xTKu5TsZ8PdPHZhud+xqTy6QTg9UnP ulsfuXVgmBlIxyG/nqCXqhZinzvXzJLTWuQViiyGPQ== X-Google-Smtp-Source: ACJfBovdMMOow5ijxAF+pueyaD80bPuxRPdftYYUQr7jaswhIqpwgDoOdYUMOepc1vN+raKiISXC4iFKkux0GdMI/Lk= X-Received: by 10.107.27.84 with SMTP id b81mr57109795iob.43.1514885182218; Tue, 02 Jan 2018 01:26:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.37.197 with HTTP; Tue, 2 Jan 2018 01:26:21 -0800 (PST) In-Reply-To: References: <7baf6db5ebfdef045c69aed44d86aada99a7f4ff.1514491125.git.theracermaster@gmail.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E19AED0@SHSMSX104.ccr.corp.intel.com> From: Ard Biesheuvel Date: Tue, 2 Jan 2018 09:26:21 +0000 Message-ID: To: Alex James Cc: "Gao, Liming" , "edk2-devel@lists.01.org" Subject: Re: [PATCH] BaseTools/PcdValueCommon: Fix PcdDataTypeUint64 format string X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2018 09:21:21 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 2 January 2018 at 09:25, Ard Biesheuvel wrot= e: > On 29 December 2017 at 02:58, Alex James wrote= : >> Hi Liming, >> >> I was able to reproduce this, will send out the v2 patch shortly. >> > > This is still broken in today's tree. Could we get a fix please? > Ehm, hold on. It is the other way around: on AARCH64, I now get PcdValueCommon.c: In function =E2=80=98__PcdSet=E2=80=99: PcdValueCommon.c:270:43: error: format =E2=80=98%lx=E2=80=99 expects argume= nt of type =E2=80=98long unsigned int=E2=80=99, but argument 3 has type =E2=80=98UINT6= 4 {aka long long unsigned int}=E2=80=99 [-Werror=3Dformat=3D] sprintf(PcdList[Index].Value, "0x%016lx", Value); >> >> On Thu, Dec 28, 2017 at 7:46 PM Gao, Liming wrote= : >> >>> This fix will trig GCC build warning. >>> >>> PcdValueCommon.c: In function '__PcdSet': >>> PcdValueCommon.c:269:35: error: format '%llx' expects argument of type >>> 'long long unsigned int', but argument 3 has type 'UINT64 {aka long >>> unsigned int}' [-Werror=3Dformat=3D] >>> sprintf(PcdList[Index].Value, "0x%016llx", Value); >>> ^ >>> >>> Thanks >>> Liming >>> > -----Original Message----- >>> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf O= f >>> Alex James >>> > Sent: Friday, December 29, 2017 4:00 AM >>> > To: edk2-devel@lists.01.org >>> > Cc: Alex James >>> > Subject: [edk2] [PATCH] BaseTools/PcdValueCommon: Fix PcdDataTypeUint= 64 >>> format string >>> > >>> > Always specify unsigned long long for PcdDataTypeUint64. This is need= ed >>> > to fix building with XCODE5. >>> > >>> > Contributed-under: TianoCore Contribution Agreement 1.1 >>> > Signed-off-by: Alex James >>> > --- >>> > BaseTools/Source/C/Common/PcdValueCommon.c | 4 ---- >>> > 1 file changed, 4 deletions(-) >>> > >>> > diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c >>> b/BaseTools/Source/C/Common/PcdValueCommon.c >>> > index 6ca0994744..f5d68e79e0 100644 >>> > --- a/BaseTools/Source/C/Common/PcdValueCommon.c >>> > +++ b/BaseTools/Source/C/Common/PcdValueCommon.c >>> > @@ -266,11 +266,7 @@ Returns: >>> > sprintf(PcdList[Index].Value, "0x%08x", (UINT32)(Value & >>> 0xffffffff)); >>> > break; >>> > case PcdDataTypeUint64: >>> > -#ifdef __GNUC__ >>> > - sprintf(PcdList[Index].Value, "0x%016lx", Value); >>> > -#else >>> > sprintf(PcdList[Index].Value, "0x%016llx", Value); >>> > -#endif >>> > break; >>> > case PcdDataTypePointer: >>> > fprintf (stderr, "PCD %s.%s.%s.%s is structure. Use >>> PcdSetPtr()\n", SkuName, DefaultValueName, TokenSpaceGuidName, >>> > TokenName); >>> > -- >>> > 2.15.1 >>> > >>> > _______________________________________________ >>> > edk2-devel mailing list >>> > edk2-devel@lists.01.org >>> > https://lists.01.org/mailman/listinfo/edk2-devel >>> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel