From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.71.26; helo=eur03-db5-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071026.outbound.protection.outlook.com [40.92.71.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 037AB2214E32C for ; Sat, 9 Dec 2017 12:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5zZppFZlyq+ESfiquUBqOTP1t6D8WTyHCx6oMAxZHrw=; b=LS/3TY2wxmwiDmN6CBXPf1c4/ZVea35DwEYlL1/NWjpu1FDypvqN8oxqIrsGLq2gyWR1t4UcOYwa9Rr6NmQHeWyrEcZ8ZsPUWQhhOO7zkQlllguYhZ87pmT/vj2++hFfFQ35I7GHZw/Zsv+88MdPJqcqnneDIuvrltJUxeELp+OT6Mo/9fErh7tyil2ouHWuFt9wQJlaIu3cYdsK8VwdQp8fDak4xuP1VDbDuMlKxz/i44Xhz9ce+AiZOeYrcmQmIGin4XiadqxANviCiQ4vVE3JFjkIh7hHbyiB8fFd2NvK+o0BuImfFRu7GoPBPiuwj01cER/vj9cTe1MnlvvTQA== Received: from VE1EUR03FT049.eop-EUR03.prod.protection.outlook.com (10.152.18.57) by VE1EUR03HT068.eop-EUR03.prod.protection.outlook.com (10.152.18.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.282.5; Sat, 9 Dec 2017 20:22:33 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com (10.152.18.53) by VE1EUR03FT049.mail.protection.outlook.com (10.152.19.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.282.5 via Frontend Transport; Sat, 9 Dec 2017 20:22:33 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::4d07:32d4:f2d5:b69c]) by AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::4d07:32d4:f2d5:b69c%13]) with mapi id 15.20.0302.012; Sat, 9 Dec 2017 20:22:33 +0000 From: Marvin H?user To: "edk2-devel@lists.01.org" CC: Zenith432 , "michael.d.kinney@intel.com" , "liming.gao@intel.com" Thread-Topic: [edk2] [PATCH] MdePkg: resolve bug 741 Thread-Index: AQHTcSYQ6wThBCWxpkGKQSaOg9lX3aM7c0Cw Date: Sat, 9 Dec 2017 20:22:33 +0000 Message-ID: References: <541697813.1899563.1512848632833.ref@mail.yahoo.com> <541697813.1899563.1512848632833@mail.yahoo.com> In-Reply-To: <541697813.1899563.1512848632833@mail.yahoo.com> Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:697E00BCD1FE17985F97E06F9DFD01517350C3745A909690A60BC68F34BABC11; UpperCasedChecksum:F2D8F9171ED506541323EB9AC47F20D9D1EF0061F95680FF7F6D43E04BFF1975; SizeAsReceived:7197; Count:46 x-tmn: [++bpX4lJgkLOwKfs1jKSNS3WUSjrbvq2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR03HT068; 6:6ehRRJsj3Nk+VsLQOTmCS2YZiE5fJf4F1whSErY1TwRUrVx2Qbxac0sb1kZ/lBLswxIWupCtOZYYj4LvlVKpet3z87RrgVP5JXnB5hahdJc/j6VqAzJX8lcWhTN+a8SD5TvjEY4OY9PtshRxZSGCDLvip5xgdDCwcoDJkcAoGkoEN+0IwlBzJdBKw7uR8ioBMl6UJGLOHsoAGxd1SODGfSUXRBLAIyFtjPVR5pZhvUssoAz8b809QovhQSxGldk1x1AZSYZ+ejiaLZ5/7dded7tNm7l25cgskQVXDohKMj5VQijBv/GD/CqPEeg2x6786rgN0MUI8qGw5AnVHrdCXLwkw4bTRwC6I7yJYhTbH7Y=; 5:EUDVWZzioBdAKDqaAE41cjAm8XgSMK0xpAs63hSIZY1I/FBgN/nDDYoyzkZl7sY7paFf82bkW2u4FeHFRFtnEcGG/27wBis+Z+lqNWOV+06TXjKWHRkAvv7unRUgKWk8+flPADw2mxnU8Mc5FVe2+KR6qK996TpTlqgSVbkqjNM=; 24:zUI9fU1yDA//vvaSMdy8gopls1nY6tQ8UgVOIzqx/rDj8RDFluKkuwzW3k+fSgOYIChkUBXd/luS0/KkWkqA38y6qRdd26Ujc+OoJkGiHO4=; 7:ZIWnCvWzCYbRIDX7iUhqLcNsDzHmQXtKXkLrK90mB2ym/2fSpvei/BY4f4sy8ZyZ7nr5CvQB5dHLsPfHnIDJs8pvyMBtoSd3fIM2H/BYF51C5f1fiRQ5uRNLZpU5WBmm4wcsnYoYW5ZOTTtzjE3rwWKq3dGSdnsgAtg1WwlTcq7IP1SSoVHvewamu5o5VOYT99k6t3y6O5Us70jP9jNgPcYDFLaoNH3YaQQT7O7F6aDxIjkUC9pvKCzW1jG3/Gmv x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:VE1EUR03HT068; x-ms-traffictypediagnostic: VE1EUR03HT068: x-ms-office365-filtering-correlation-id: b9cbf2c5-3f0c-4cce-96de-08d53f42944d x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:VE1EUR03HT068; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VE1EUR03HT068; x-forefront-prvs: 05168A3970 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR03HT068; H:AM4PR06MB1491.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9cbf2c5-3f0c-4cce-96de-08d53f42944d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Dec 2017 20:22:33.0516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT068 Subject: Re: [PATCH] MdePkg: resolve bug 741 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: Sat, 09 Dec 2017 20:18:05 -0000 Content-Language: de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable For code style purposes, I suggest to declare the first member of the langu= age list as a third argument, process it, and then use it to get the follow= ing from the VA. Also, I think you forgot to CC the MdePkg maintainers, so I did with this m= ail. Regards, Marvin. > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Zenith432 > Sent: Saturday, December 9, 2017 8:44 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH] MdePkg: resolve bug 741 >=20 > This is a proposal to resolve bug 741: UefiLib.c compilation failure with= clang > error: passing an object that undergoes default argument promotion to > 'va_start' has undefined behavior [-Werror,-Wvarargs]" >=20 > Rationale: > 1. Default argument promotion causes the sizeof a function's argument to = be > different than the corresponding parameter's sizeof. This may break a > permissible implemenation of stdarg.h, which is why it is considered > undefined behavior in C. The condition should be repaired rather than > silenced with -Wno-varargs. > 2. The warning is due to the last non-variadic parameter of GetBestLangua= ge > having type BOOLEAN. > 3. BOOLEAN is typedef'd to 'unsigned char' in all ProcessorBind.h. > 4. 'unsigned char' goes default argument promotion to int. > 5. All ProcessorBind.h typedef the type INT32 to either 'int' or some 32-= bit > equivalent. > 6. As a result it is safe to replace the type of the parameter from BOOLE= AN to > INT32 in all current supported architectures. > 7. The change is consistent with the BOOLEAN argument being converted to > INT32 at the caller site. The function GetBestLanguage currently converts= the > argument from INT32 back to BOOLEAN, however the function's logic is not > disturbed by treating the argument as an INT32. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Zenith432 > --- > 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/UefiLib.h > index 0b14792a..5d98eb26 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 INT32 Iso639Language, > ... > ); >=20 > diff --git a/MdePkg/Library/UefiLib/UefiLib.c > b/MdePkg/Library/UefiLib/UefiLib.c > index a7eee012..57236511 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 INT32 Iso639Language, > ... > ) > { > -- > 2.14.3 (Apple Git-98) > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel