To permit many existing platforms to build with -Wunused-parameter, on
GCC and CLANG, the unused parameters need to be annotated as such.
Existing regexp code already uses ARG_UNUSED for this, but it is really
needed across the codebase - so add a version called UNUSED in Base.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <[email protected]>
---

Change since RFC: rename ARG_UNUSED -> UNUSED.

 MdePkg/Include/Base.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 89b2aed..a68b209 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -189,6 +189,15 @@ struct _LIST_ENTRY {
 ///
 #define OPTIONAL
 
+///
+/// Function argument intentionally unused in function.
+///
+#if defined(__GNUC__) || defined(__clang__)
+  #define UNUSED  __attribute__ ((unused))
+#else
+  #define UNUSED
+#endif
+
 //
 //  UEFI specification claims 1 and 0. We are concerned about the
 //  complier portability so we did it this way.
-- 
2.1.4

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

Reply via email to