On 17 March 2016 at 19:51, Laszlo Ersek <[email protected]> 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:
> <http://people.redhat.com/lersek/unused-parameter.txt>.
>
> 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]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to