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: Tue, 26 Dec 2017 21:00:32 +0100	[thread overview]
Message-ID: <CAN9vWD+40wAeTQp0TqnnEuvJTmViOFiUq8NL2RN4brRw6h-upA@mail.gmail.com> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E198BE9@SHSMSX104.ccr.corp.intel.com>

Liming:
I've never used VS to compile edk2 but to me it looks like it doesn't like
what NORETURN is expanding to ('__declspec(noreturn)').

If that is the case it's a generic bug because this patch set did not add
the NORETURN macro.


On Tue, Dec 26, 2017 at 5:51 PM, Gao, Liming <liming.gao@intel.com> wrote:

> Michael:
>
>   I suggest to add comments for each definition although there is
> redundant.
>
>
>
>   Besides, after I apply these three patches, and build MdePkg.dsc with
> VS2015x86. It will report below error. Could you help look it?
>
>
>
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\Vc\bin\cl.exe" /Foc:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\
> IA32\MdePkg\Library\BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\OUTPUT\.\X86Cache.obj
> /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL
> /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw -D DISABLE_NEW_DEPRECATED_INTERFACES
> /Ic:\r9tips\allpkg\edk2\MdePkg\Library\BaseCacheMaintenanceLib
> /Ic:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\IA32\MdePkg\Library\
> BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\DEBUG
> /Ic:\r9tips\allpkg\edk2\MdePkg  /Ic:\r9tips\allpkg\edk2\MdePkg\Include
> /Ic:\r9tips\allpkg\edk2\MdePkg\Include\Ia32 c:\r9tips\allpkg\edk2\MdePkg\
> Library\BaseCacheMaintenanceLib\X86Cache.c
>
> X86Cache.c
>
> c:\r9tips\allpkg\edk2\MdePkg\Include\Library/BaseLib.h(4933): error
> C2059: syntax error: 'type'
>
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 14.0\Vc\bin\cl.exe"' : return code '0x2'
>
> Stop.
>
>
>
> Thanks
>
> Liming
>
> *From:* Michael Zimmermann [mailto:sigmaepsilon92@gmail.com]
> *Sent:* Monday, December 25, 2017 11:50 PM
> *To:* Gao, Liming <liming.gao@intel.com>
> *Cc:* Ard Biesheuvel <ard.biesheuvel@linaro.org>; edk2-devel@lists.01.org;
> Kinney, Michael D <michael.d.kinney@intel.com>
>
> *Subject:* Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
>
>
>
> 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-26 19:55 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
2017-12-26 16:51         ` Gao, Liming
2017-12-26 20:00           ` Michael Zimmermann [this message]
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+40wAeTQp0TqnnEuvJTmViOFiUq8NL2RN4brRw6h-upA@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