From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c06::231; helo=mail-oi0-x231.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 65D9F2034B42E for ; Tue, 26 Dec 2017 11:55:39 -0800 (PST) Received: by mail-oi0-x231.google.com with SMTP id w125so24241778oie.7 for ; Tue, 26 Dec 2017 12:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2PxxoQOKoUHE1Hvpf/hTb+SA1EwfNjLxO05dBTJDMaY=; b=AyM1mHn03SyybPI0h2Zu7Fay1WE96lqrCkCmJYXBJwq5pejj4vek2SS4GDMXB92Dfg fN6FHEPSbKCtbm0GRsvFAcxlSN0rY3HyD1F0mzg5MRX6kGNacz0rtuivGKxB4KgRHFI9 dp3q34TBBWtvWh9YrYOVzuh1Bhn5jQfMEgMyL2dJkDxpMo7+59BuVXBPob77JhpSMSjp vMgiRFDBFW/qO5rryykK44uizjSe/l69U6gIXx+JKr3VsQDNLsgqafa3eunVrdrzkqm1 dXCp4ki6AVpop43nkSoKX4aVnUuQgN5H7t4sMgLxOGZv5T9gJ3/zXt1g4IxBvdhWsXKF NldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2PxxoQOKoUHE1Hvpf/hTb+SA1EwfNjLxO05dBTJDMaY=; b=B0E58XZGWzP9KqA5vTaz2jfvngcg2XungwpWslVeJHBHCoZlxSpB+wTyBpTDeBUJNo ZJ7NfiWH/COD/tLNbPh8+aHTAHPwdQP8QwvjuV5C2QxpOGo7SXoezvKotDVTefXJAdXh wzVqe/yHSkDHlYOPJXHiadrNFW+oNBuszdaP3wZqT1rSZvuZXKphCrI02C1hYaYLeln+ YFMg5GMXcf+xgFuqJhf0BXkE1UthH9h74O87/yxFFBV6HULmzDQJko7OsvsDCNVDYtng dhFEnRpiNJsswHSzKDPQL7egindEuN5w0ROiD5HXEvXrZKhXqCu0ZzI8tmaiDP946HxM 6DXw== X-Gm-Message-State: AKGB3mJQHmqI5+jmzZ5KveuxwDmWYIpPmzxLE/E//2SvfCAK3hO03VuJ fngREWujQPyLFclDQ79B4fni7MvHLWSHDOJVP9U= X-Google-Smtp-Source: ACJfBovl7IQ3N8OABo0OL/c1ACh/W18RwmllRIuzQQ1cuwtBk9UV+ifRfah4P2L0NU7Fi7qqa1AsxtTFd26kP8F8J4Y= X-Received: by 10.202.73.9 with SMTP id w9mr19108667oia.227.1514318433055; Tue, 26 Dec 2017 12:00:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.68.230 with HTTP; Tue, 26 Dec 2017 12:00:32 -0800 (PST) In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E198BE9@SHSMSX104.ccr.corp.intel.com> References: <20171222072336.23504-1-sigmaepsilon92@gmail.com> <20171222072336.23504-2-sigmaepsilon92@gmail.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E1961C7@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E198BE9@SHSMSX104.ccr.corp.intel.com> From: Michael Zimmermann Date: Tue, 26 Dec 2017 21:00:32 +0100 Message-ID: To: "Gao, Liming" Cc: Ard Biesheuvel , "edk2-devel@lists.01.org" , "Kinney, Michael D" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 19:55:39 -0000 Content-Type: text/plain; charset="UTF-8" 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 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 > *Cc:* Ard Biesheuvel ; edk2-devel@lists.01.org; > Kinney, Michael D > > *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 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 > >Cc: edk2-devel@lists.01.org; Kinney, Michael D > >; Gao, Liming > >Subject: Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute > > > >On 22 December 2017 at 07:23, M1cha wrote: > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Michael Zimmermann > >> --- > >> 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 > >> > > >