public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: Alex James <theracermaster@gmail.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] BaseTools/PcdValueCommon: Fix PcdDataTypeUint64 format string
Date: Fri, 29 Dec 2017 01:46:08 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E19AED0@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <7baf6db5ebfdef045c69aed44d86aada99a7f4ff.1514491125.git.theracermaster@gmail.com>

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=format=]
     sprintf(PcdList[Index].Value, "0x%016llx", Value);
                                   ^

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Alex James
> Sent: Friday, December 29, 2017 4:00 AM
> To: edk2-devel@lists.01.org
> Cc: Alex James <theracermaster@gmail.com>
> Subject: [edk2] [PATCH] BaseTools/PcdValueCommon: Fix PcdDataTypeUint64 format string
> 
> Always specify unsigned long long for PcdDataTypeUint64. This is needed
> to fix building with XCODE5.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Alex James <theracermaster@gmail.com>
> ---
>  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


  reply	other threads:[~2017-12-29  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 19:59 [PATCH] BaseTools/PcdValueCommon: Fix PcdDataTypeUint64 format string Alex James
2017-12-29  1:46 ` Gao, Liming [this message]
2017-12-29  2:58   ` Alex James
2018-01-02  9:25     ` Ard Biesheuvel
2018-01-02  9:26       ` Ard Biesheuvel
2018-01-02 12:18         ` Gao, Liming
2018-01-02 15:09           ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E19AED0@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox