Support compile time argument consistency checking for functions that
accept a PrintLib format string followed by a variable argument list.
Macro 'EFIFORMAT' added to the function prototype accepts a single
argument indicating which function argument holds the format string.
The EFIFORMAT macro assumes the variable argument list immediately
follows the format string. Format string argument checking requires
a compiler that understands EDK2 format strings, such as GCC with
the gcc_format from BaseTools/gcc applied.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <sc...@notabs.org>
---


 DuetPkg/DxeIpl/Debug.h | 1 +
 DuetPkg/EfiLdr/Debug.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/DuetPkg/DxeIpl/Debug.h b/DuetPkg/DxeIpl/Debug.h
index 7fcad26..0f9e65f 100644
--- a/DuetPkg/DxeIpl/Debug.h
+++ b/DuetPkg/DxeIpl/Debug.h
@@ -27,6 +27,7 @@ PrintHeader (
   );
 
 VOID
+EFIFORMAT (1)
 PrintString (
   IN CONST CHAR8  *FormatString,
   ...
diff --git a/DuetPkg/EfiLdr/Debug.h b/DuetPkg/EfiLdr/Debug.h
index f6aa7a2..f93d56a 100644
--- a/DuetPkg/EfiLdr/Debug.h
+++ b/DuetPkg/EfiLdr/Debug.h
@@ -27,6 +27,7 @@ PrintHeader (
   );
 
 VOID
+EFIFORMAT (1)
 PrintString (
   IN CONST CHAR8  *FormatString,
   ...


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

Reply via email to