public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Michael Zimmermann <sigmaepsilon92@gmail.com>
To: "Gao, Liming" <liming.gao@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	 "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
Date: Mon, 25 Dec 2017 16:50:28 +0100	[thread overview]
Message-ID: <CAN9vWD+PcSqkx6g6f7Lc+CKz+1=C3WtW3bXdtm-q1DCgFySMUg@mail.gmail.com> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1961C7@SHSMSX104.ccr.corp.intel.com>

Liming:
The other macros have comments both before the compiler directives and
before each define for each compiler.
To me it looks like these are slightly differently formulated only and
kinda redundant too.
Is there a rule or do you have suggestions for writing comments for this
kind of macro?

On Mon, Dec 25, 2017 at 4:11 AM, Gao, Liming <liming.gao@intel.com> wrote:

> Micha:
>    Could you add comments for new macro RETURNS_TWICE like others, such as
> ANALYZER_NORETURN?
>
> >-----Original Message-----
> >From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> >Sent: Friday, December 22, 2017 11:24 PM
> >To: M1cha <sigmaepsilon92@gmail.com>
> >Cc: edk2-devel@lists.01.org; Kinney, Michael D
> ><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> >Subject: Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
> >
> >On 22 December 2017 at 07:23, M1cha <sigmaepsilon92@gmail.com> wrote:
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
> >> ---
> >>  MdePkg/Include/Base.h | 10 ++++++++++
> >>  1 file changed, 10 insertions(+)
> >>
> >> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> >> index 22ab5d3715fb..c863de407418 100644
> >> --- a/MdePkg/Include/Base.h
> >> +++ b/MdePkg/Include/Base.h
> >> @@ -218,6 +218,16 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE,
> >4);
> >>    #endif
> >>  #endif
> >>
> >> +#ifndef RETURNS_TWICE
> >> +  #if defined (__GNUC__) || defined (__clang__)
> >> +    #define RETURNS_TWICE  __attribute__((returns_twice))
> >> +  #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
> >> +    #define RETURNS_TWICE
> >> +  #else
> >> +    #define RETURNS_TWICE
> >
> >What is the point of having two versions that are #defined to nothing?
> >
> >> +  #endif
> >> +#endif
> >> +
> >>  //
> >>  // For symbol name in assembly code, an extra "_" is sometimes
> necessary
> >>  //
> >> --
> >> 2.15.1
> >>
>


  reply	other threads:[~2017-12-25 15:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22  7:23 [PATCH 0/3] fix GCC optimizations and warnings for SetJump/LongJump M1cha
2017-12-22  7:23 ` [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute M1cha
2017-12-22 15:24   ` Ard Biesheuvel
2017-12-22 18:27     ` Michael Zimmermann
2017-12-25  3:11     ` Gao, Liming
2017-12-25 15:50       ` Michael Zimmermann [this message]
2017-12-26 16:51         ` Gao, Liming
2017-12-26 20:00           ` Michael Zimmermann
2017-12-27 15:56             ` Gao, Liming
2017-12-22  7:23 ` [PATCH 2/3] MdePkg/BaseLib: add attribute 'RETURNS_TWICE' to SetJump M1cha
2017-12-22 15:27   ` Ard Biesheuvel
2017-12-22  7:23 ` [PATCH 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump M1cha
2017-12-22 15:27   ` Ard Biesheuvel
2017-12-22 17:55 ` [PATCH 0/3] fix GCC optimizations and warnings for SetJump/LongJump Kinney, Michael D
2017-12-22 18:26   ` Michael Zimmermann
2017-12-22 19:01     ` Kinney, Michael D

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='CAN9vWD+PcSqkx6g6f7Lc+CKz+1=C3WtW3bXdtm-q1DCgFySMUg@mail.gmail.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