From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B8CFC21A16E47 for ; Mon, 15 May 2017 22:10:39 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2017 22:10:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,347,1491289200"; d="scan'208";a="1148250825" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 15 May 2017 22:10:39 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 May 2017 22:10:39 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 May 2017 22:10:38 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Tue, 16 May 2017 13:10:36 +0800 From: "Gao, Liming" To: Sergey Temerkhanov , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] MdePkg: Fix undefined behavior on variadic parameters Thread-Index: AQHSzfAyZrqQmCd2hkaaBmjkinJcnqH2aIWQ Date: Tue, 16 May 2017 05:10:35 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D72E8BC@shsmsx102.ccr.corp.intel.com> References: <1494903391-716-1-git-send-email-s.temerkhanov@gmail.com> <1494903391-716-2-git-send-email-s.temerkhanov@gmail.com> In-Reply-To: <1494903391-716-2-git-send-email-s.temerkhanov@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdePkg: Fix undefined behavior on variadic parameters 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: , X-List-Received-Date: Tue, 16 May 2017 05:10:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sergey: Could you give more detail on the undefined behavior on variadic paramete= rs? I see https://bugzilla.tianocore.org/show_bug.cgi?id=3D410 describe this = issues found in the latest CLANG tool chain. Do you find other tool chain r= eports it? Thanks Liming > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Se= rgey Temerkhanov > Sent: Tuesday, May 16, 2017 10:57 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH] MdePkg: Fix undefined behavior on variadic parame= ters >=20 > Fix undefined behavior by avoiding parameter type promotion >=20 > Signed-off-by: Sergey Temerkhanov > --- > MdePkg/Include/Library/UefiLib.h | 2 +- > MdePkg/Library/UefiLib/UefiLib.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/Ue= fiLib.h > index 0b14792..4e4697c 100644 > --- a/MdePkg/Include/Library/UefiLib.h > +++ b/MdePkg/Include/Library/UefiLib.h > @@ -818,7 +818,7 @@ CHAR8 * > EFIAPI > GetBestLanguage ( > IN CONST CHAR8 *SupportedLanguages, > - IN BOOLEAN Iso639Language, > + IN UINTN Iso639Language, > ... > ); >=20 > diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/Ue= fiLib.c > index a7eee01..74528ec 100644 > --- a/MdePkg/Library/UefiLib/UefiLib.c > +++ b/MdePkg/Library/UefiLib/UefiLib.c > @@ -1514,7 +1514,7 @@ CHAR8 * > EFIAPI > GetBestLanguage ( > IN CONST CHAR8 *SupportedLanguages, > - IN BOOLEAN Iso639Language, > + IN UINTN Iso639Language, > ... > ) > { > -- > 2.7.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel