From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: michael.d.kinney@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Mon, 15 Apr 2019 14:52:02 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Apr 2019 14:52:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,355,1549958400"; d="scan'208";a="337882467" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga005.fm.intel.com with ESMTP; 15 Apr 2019 14:52:01 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 14:52:01 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.24]) by ORSMSX162.amr.corp.intel.com ([169.254.3.253]) with mapi id 14.03.0415.000; Mon, 15 Apr 2019 14:52:01 -0700 From: "Michael D Kinney" To: Leif Lindholm , "Wu, Hao A" , "Kinney, Michael D" CC: Ard Biesheuvel , "devel@edk2.groups.io" , Andrew Fish , "Zeng, Star" , "Dong, Eric" , "Ni, Ray" , "Gao, Liming" , "Carsey, Jaben" , "Shi, Steven" , "Wang, Jian J" Subject: Re: [PATCH v6 1/7] MdeModulePkg: introduce PE/COFF image emulator protocol Thread-Topic: [PATCH v6 1/7] MdeModulePkg: introduce PE/COFF image emulator protocol Thread-Index: AQHU8vungLQCFm7XQkGR2qe3cxYLsqY84vWAgACAVID///xcgIAAZB+A Date: Mon, 15 Apr 2019 21:52:00 +0000 Message-ID: References: <20190414195233.30045-1-ard.biesheuvel@linaro.org> <20190414195233.30045-2-ard.biesheuvel@linaro.org> <20190415090229.biz2hxcuvo35ieyr@bivouac.eciton.net> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Leif, How about using the following pragma instead if include guards? =09 #pragma once https://en.wikipedia.org/wiki/Pragma_once This appears to be supports by GCC 3.4 and higher, clang, and VS. Might even speed up builds a bit. Mike > -----Original Message----- > From: Kinney, Michael D > Sent: Monday, April 15, 2019 8:53 AM > To: Leif Lindholm ; Wu, Hao A > ; Kinney, Michael D > > Cc: Ard Biesheuvel ; > devel@edk2.groups.io; Andrew Fish ; > Zeng, Star ; Dong, Eric > ; Ni, Ray ; Gao, > Liming ; Carsey, Jaben > ; Shi, Steven > ; Wang, Jian J > > Subject: RE: [PATCH v6 1/7] MdeModulePkg: introduce > PE/COFF image emulator protocol >=20 > Hi Leif, >=20 > This is not a macro that is to be used by C code. It > is a technique > to prevent recursive includes on a .h file. As a > result, we do not want > to use the C Coding Standard macro style. >=20 > Are there other techniques to prevent recursive > includes? >=20 > I agree that macros/symbols that start with single or > double '_' > are reserved by compilers/linkers, which is why the > warning is > triggered and it would be better if we use a different > technique. >=20 > The current style assumes that the define symbol used > will not > collide with a compiler/linker symbol. The names are > verbose, > so the chances of a collision are very low. >=20 > Mike >=20 > > -----Original Message----- > > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > > Sent: Monday, April 15, 2019 2:02 AM > > To: Wu, Hao A > > Cc: Ard Biesheuvel ; > > devel@edk2.groups.io; Kinney, Michael D > > ; Andrew Fish > > ; Zeng, Star ; > > Dong, Eric ; Ni, Ray > > ; Gao, Liming > ; > > Carsey, Jaben ; Shi, Steven > > ; Wang, Jian J > > > > Subject: Re: [PATCH v6 1/7] MdeModulePkg: introduce > > PE/COFF image emulator protocol > > > > On Mon, Apr 15, 2019 at 01:23:11AM +0000, Wu, Hao A > > wrote: > > > > + This program and the accompanying materials > are > > licensed and made > > > > available > > > > + under the terms and conditions of the BSD > > License which accompanies this > > > > + distribution. The full text of the license > may > > be found at > > > > + http://opensource.org/licenses/bsd-license.php > > > > + > > > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD > LICENSE > > ON AN "AS IS" > > > > BASIS, > > > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > > KIND, EITHER > > > > EXPRESS OR IMPLIED. > > > > + > > > > +**/ > > > > + > > > > +#ifndef PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID_H > > > > +#define PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID_H > > > > > > Hello Ard, > > > > > > Sorry for the delayed response. > > > > > > Could you help to use: > > > _PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID_H_ > > > > > > here to please the Ecc checker when you push the > > series? > > > > Hmm... > > > > Not a major issue, but I'll mention it anyway (which > I > > mentioned to > > Andrew/Mike at Linaro Connect in Vancouver last > year): > > clang has a warning, enabled by -Wreserved-id-macro, > > which complains > > about this. > > > > The Coding Style matches this, suggesting > > MACROS_SHOULD_BE_WRITTEN_THUS_. So do we need to fix > > Ecc? > > > > Regards, > > > > Leif