Michael,

For many aspects of a function declaration and function implementation the C
compiler requires the headers to match.  I think it is good practice to have 
them match.

In general, when implementing a library instance, you can take a copy of the 
library
class .h file into a library instance .c file and fill in the body of the 
functions.  When
using this approach, the function headers are always identical.

Mike

From: Michael Zimmermann [mailto:sigmaepsilo...@gmail.com]
Sent: Friday, December 22, 2017 10:27 AM
To: Kinney, Michael D <michael.d.kin...@intel.com>
Cc: edk2-devel@lists.01.org; Ard Biesheuvel <ard.biesheu...@linaro.org>; Gao, 
Liming <liming....@intel.com>
Subject: Re: [edk2] [PATCH 0/3] fix GCC optimizations and warnings for 
SetJump/LongJump

Is adding attributes to both header and source files an UEFI coding convention?
Because for the compiler it's only necessary to do that in the header files 
afaik.

Thanks
Michael

On Fri, Dec 22, 2017 at 6:55 PM, Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>> wrote:
I see the .h file updates here.

I think the C files in MdePkg/Library/BaseLib also need
to be updated for this patch series to be complete.

Thanks,

Mike

> -----Original Message-----
> From: M1cha [mailto:sigmaepsilo...@gmail.com<mailto:sigmaepsilo...@gmail.com>]
> Sent: Thursday, December 21, 2017 11:24 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Ard Biesheuvel 
> <ard.biesheu...@linaro.org<mailto:ard.biesheu...@linaro.org>>; Kinney,
> Michael D <michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>; 
> Gao, Liming
> <liming....@intel.com<mailto:liming....@intel.com>>
> Subject: [edk2] [PATCH 0/3] fix GCC optimizations and
> warnings for SetJump/LongJump
>
> I've already discussed this in past but never actually
> sent proper
> patches for some reason.
>
> This patch series is about fixing problems with these
> functions when
> using GCC.
>
> M1cha (3):
>   MdePkg: add RETURNS_TWICE attribute
>   MdePkg/BaseLib: add attribute 'RETURNS_TWICE' to
> SetJump
>   MdePkg: add NORETURN attribute to LongJump and
> InternalLongJump
>
>  MdePkg/Include/Base.h                     | 10
> ++++++++++
>  MdePkg/Include/Library/BaseLib.h          |  2 ++
>  MdePkg/Library/BaseLib/BaseLibInternals.h |  1 +
>  3 files changed, 13 insertions(+)
>
> --
> 2.15.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to