public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Andrew Fish <afish@apple.com>, "Zeng, Star" <star.zeng@intel.com>,
	"Dong, Eric" <eric.dong@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Carsey, Jaben" <jaben.carsey@intel.com>,
	"Shi, Steven" <steven.shi@intel.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>
Subject: Re: [PATCH v6 1/7] MdeModulePkg: introduce PE/COFF image emulator protocol
Date: Mon, 15 Apr 2019 15:53:17 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5B9C94B8D@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <20190415090229.biz2hxcuvo35ieyr@bivouac.eciton.net>

Hi Leif,

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.

Are there other techniques to prevent recursive includes?

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.

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.

Mike

> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Monday, April 15, 2019 2:02 AM
> To: Wu, Hao A <hao.a.wu@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>;
> devel@edk2.groups.io; Kinney, Michael D
> <michael.d.kinney@intel.com>; Andrew Fish
> <afish@apple.com>; Zeng, Star <star.zeng@intel.com>;
> Dong, Eric <eric.dong@intel.com>; Ni, Ray
> <ray.ni@intel.com>; Gao, Liming <liming.gao@intel.com>;
> Carsey, Jaben <jaben.carsey@intel.com>; Shi, Steven
> <steven.shi@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>
> 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

  parent reply	other threads:[~2019-04-15 15:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 19:52 [PATCH v6 0/7] MdeModulePkg: add support for dispatching foreign arch PE/COFF images Ard Biesheuvel
2019-04-14 19:52 ` [PATCH v6 1/7] MdeModulePkg: introduce PE/COFF image emulator protocol Ard Biesheuvel
2019-04-15  1:23   ` Wu, Hao A
2019-04-15  9:02     ` Leif Lindholm
2019-04-15 14:22       ` [edk2-devel] " Liming Gao
2019-04-15 15:53       ` Michael D Kinney [this message]
2019-04-15 21:52         ` Michael D Kinney
2019-04-14 19:52 ` [PATCH v6 2/7] MdeModulePkg/DxeCore: invoke the emulator protocol for foreign images Ard Biesheuvel
2019-04-15  1:23   ` Wu, Hao A
2019-04-14 19:52 ` [PATCH v6 3/7] MdeModulePkg/PciBusDxe: dispatch option ROMs for foreign architectures Ard Biesheuvel
2019-04-15 20:23   ` [edk2-devel] " Ni, Ray
2019-04-16  6:02   ` Gary Lin
2019-04-16 16:20     ` Ard Biesheuvel
2019-04-14 19:52 ` [PATCH v6 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images Ard Biesheuvel
2019-04-15 20:22   ` [edk2-devel] " Ni, Ray
2019-04-14 19:52 ` [PATCH v6 5/7] MdeModulePkg/EbcDxe: implement the PE/COFF emulator protocol Ard Biesheuvel
2019-04-14 19:52 ` [PATCH v6 6/7] MdePkg/UefiBaseType.h: treat EBC as a non-native machine type Ard Biesheuvel
2019-04-14 19:52 ` [PATCH v6 7/7] MdeModulePkg/DxeCore: remove explicit EBC handling Ard Biesheuvel
2019-04-15  1:25 ` [PATCH v6 0/7] MdeModulePkg: add support for dispatching foreign arch PE/COFF images Wu, Hao A
2019-04-15  2:04   ` [edk2-devel] " 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=E92EE9817A31E24EB0585FDF735412F5B9C94B8D@ORSMSX113.amr.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