]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/GenFw: Fix a bug for GCC build
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 17 Feb 2016 08:57:44 +0000 (16:57 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 18 Feb 2016 03:25:54 +0000 (11:25 +0800)
current GCC build report error: 'for' loop initial declarations are only
allowed in C99 or C11 mode, the patch fix this failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools/Source/C/GenFw/Elf64Convert.c

index d115291b062c9f4c3ae5f1876e467aeaa0ebe705..8fca7fba2a255852c0b20367f42c9dbd7ca4dedc 100644 (file)
@@ -314,7 +314,8 @@ GetSymName (
   UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;\r
 \r
   bool foundEnd = false;\r
-  for (UINT32 i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {\r
+  UINT32 i;\r
+  for (i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {\r
     foundEnd = StrtabContents[i] == 0;\r
   }\r
   assert(foundEnd);\r
index 3b5f63010388ef692ef8b83528e868eab947833b..024a2a0d53573e1b503d039617e8975e2c109b4d 100644 (file)
@@ -306,7 +306,8 @@ GetSymName (
   UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;\r
 \r
   bool foundEnd = false;\r
-  for (UINT32 i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {\r
+  UINT32 i;\r
+  for (i= Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {\r
     foundEnd = StrtabContents[i] == 0;\r
   }\r
   assert(foundEnd);\r