public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset)
@ 2022-02-02 20:51 Rebecca Cran
  2022-02-02 21:18 ` Michael D Kinney
  0 siblings, 1 reply; 3+ messages in thread
From: Rebecca Cran @ 2022-02-02 20:51 UTC (permalink / raw)
  To: Michael D Kinney, Liming Gao, Zhiguang Liu, devel

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

With the CLANG38 toolset (clang version 13.0.0) MdePkg fails to build in RELEASE mode because Status is only used by an assert.

edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15: 
error: variable 'Status' set but not used 
[-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;
              ^
edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:347:15: 
error: variable 'Status' set but not used 
[-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;
              ^
edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:818:15: 
error: variable 'Status' set but not used 
[-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;

-- 
Rebecca Cran

[-- Attachment #2: Type: text/html, Size: 1278 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset)
  2022-02-02 20:51 MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset) Rebecca Cran
@ 2022-02-02 21:18 ` Michael D Kinney
  2022-02-03  2:01   ` [edk2-devel] " Andrew Fish
  0 siblings, 1 reply; 3+ messages in thread
From: Michael D Kinney @ 2022-02-02 21:18 UTC (permalink / raw)
  To: Rebecca Cran, Gao, Liming, Liu, Zhiguang, devel@edk2.groups.io,
	Kinney, Michael D

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

Hi Rebecca,

GCC added -Wno-unused-but-set-variable back in 2016 for RELEASE builds to address this same issue

https://github.com/tianocore/edk2/commit/20d00edf21d2f2144921622891d8b59a1553cd83

Then later added -Wno-unused-const-variable

https://github.com/tianocore/edk2/commit/8b6366f8758426fd6710646574b9a7e583e0fe0d

Mike

From: Rebecca Cran <quic_rcran@quicinc.com>
Sent: Wednesday, February 2, 2022 12:52 PM
To: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
Subject: MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset)


With the CLANG38 toolset (clang version 13.0.0) MdePkg fails to build in RELEASE mode because Status is only used by an assert.



edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
 EFI_STATUS  Status;
             ^
edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:347:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
 EFI_STATUS  Status;
             ^
edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:818:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
 EFI_STATUS  Status;

--
Rebecca Cran

[-- Attachment #2: Type: text/html, Size: 42733 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset)
  2022-02-02 21:18 ` Michael D Kinney
@ 2022-02-03  2:01   ` Andrew Fish
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Fish @ 2022-02-03  2:01 UTC (permalink / raw)
  To: devel, michael.d.kinney; +Cc: Rebecca Cran, Gao, Liming, Liu, Zhiguang

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

Mike,

That sounds like the right fox to me. Disable the warning.
> On Feb 2, 2022, at 1:18 PM, Michael D Kinney <michael.d.kinney@intel.com> wrote:
> 
> 
> Hi Rebecca,
>  
> GCC added -Wno-unused-but-set-variable back in 2016 for RELEASE builds to address this same issue
>  
> https://github.com/tianocore/edk2/commit/20d00edf21d2f2144921622891d8b59a1553cd83
>  
> Then later added -Wno-unused-const-variable
>  
> https://github.com/tianocore/edk2/commit/8b6366f8758426fd6710646574b9a7e583e0fe0d
>  
> Mike
>  
> From: Rebecca Cran <quic_rcran@quicinc.com> 
> Sent: Wednesday, February 2, 2022 12:52 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
> Subject: MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset)
>  
> With the CLANG38 toolset (clang version 13.0.0) MdePkg fails to build in RELEASE mode because Status is only used by an assert.
>  
> edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable] 
>  EFI_STATUS  Status; 
>              ^ 
> edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:347:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable] 
>  EFI_STATUS  Status; 
>              ^ 
> edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:818:15: error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable] 
>  EFI_STATUS  Status;
> 
> -- 
> Rebecca Cran
> 
> 

[-- Attachment #2: Type: text/html, Size: 42830 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-03  2:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-02 20:51 MdePkg fails to build in RELEASE mode with clang 13 (CLANG38 toolset) Rebecca Cran
2022-02-02 21:18 ` Michael D Kinney
2022-02-03  2:01   ` [edk2-devel] " Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox