Laszlo:
  I understand the request to BaseTools is that AutoGen code can pass GCC or 
MSFT compiler without any warning. If so, EDKII module can enable non default 
warnings in itself. I will evaluate BaseTools.
  And, you raise one issue that the different ARCHs have the different warning 
setting. I suggest to keep them consistent to avoid the different build 
results. How about adding -Wno-unused-but-set-variable option to AARCH64 DEBUG.

Besides, Shumin is a young man. :)

Thanks
Liming
From: edk2-devel [mailto:[email protected]] On Behalf Of Leif 
Lindholm
Sent: Friday, March 18, 2016 4:50 PM
To: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>; [email protected] 
<[email protected]>; Andrew Fish <[email protected]>; Gao, Liming 
<[email protected]>; Kinney, Michael D <[email protected]>; Qiu, 
Shumin <[email protected]>
Subject: Re: [edk2] [PATCH] MdePkg: add UNUSED notation to Base.h

On 17 March 2016 at 19:51, Laszlo Ersek wrote:
>> I must confess to no small amount of surprise that optionally adding
>> the ability to tag an unused argument as unused is controversial.
>
> I'm also surprised, but by a different thing. :)

> (2) Beyond removing "-Wno-unused-but-set-variable", I then added
> "-Wunused-parameter -Wunused-but-set-parameter".
>
> Oh boy. :) First, a large number of "AutoGen.c" files (maybe all of
> them?) seem to hit it. I simply filtered those out.

Yeah, so far I have:

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
b/BaseTools/Source/Python/AutoGen/GenC.py
index 842d8bd..418bc47 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -59,6 +59,9 @@ gAutoGenHeaderString = TemplateString("""\
${FileName}
Abstract: Auto-generated ${FileName} for building module or library.
**/
+#pragma GCC diagnostic ignored "-Wunused-macros"
+#pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
""")

gAutoGenHPrologueString = TemplateString("""


(No, I'm _not_ suggesting merging that. Hilariously, that snippet
causes build failures with GCC due to unknown pragmas...)

> Second, the remaining set of warnings is also huge: almost 4000
> instances. The list of locations is too large to attach or paste (and I
> don't think the list will allow compressed attachments), so I'm
> uploading it here:
> .
>
> If I understand correctly, if we wanted to enable "-Wunused-parameter
> -Wunused-but-set-parameter" even just occasionally, these ~4000
> instances would have to be audited, and each should be either fixed
> (i.e., internal functions should drop the parameters) or marked UNUSED
> (i.e., library instances and PPI/protocol implementations should
> annotate their definitions of public functions).
>
> Thus, this is what surprises me. It looks daunting.

Oh indeed.
I just wanted to tools to enable it - and it sounds like that bit is
not the controversial one.

/
Leif
_______________________________________________
edk2-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to