[edk2] [Patch] BaseTools: Fix the error about loop initial declarations

Yonghong Zhu posted 1 patch 6 years, 3 months ago
Failed in applying to current master (apply log)
BaseTools/Source/C/DevicePath/DevicePath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[edk2] [Patch] BaseTools: Fix the error about loop initial declarations
Posted by Yonghong Zhu 6 years, 3 months ago
From: Yunhua Feng <yunhuax.feng@intel.com>

We met compile error about loop initial declarations are only allowed
in C99 or C11 mode on GCC48/GCC49.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 BaseTools/Source/C/DevicePath/DevicePath.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/C/DevicePath/DevicePath.c
index 4c87163..4baa612 100644
--- a/BaseTools/Source/C/DevicePath/DevicePath.c
+++ b/BaseTools/Source/C/DevicePath/DevicePath.c
@@ -104,11 +104,12 @@ Returns:
 
 
 void print_mem(void const *vp, size_t n)
 {
     unsigned char const *p = vp;
-    for (size_t i=0; i<n; i++) {
+    size_t i;
+    for (i = 0; i < n; i++) {
         printf("0x%02x ", p[i]);
   }
 }
 
 VOID
-- 
2.6.1.windows.1

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