summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/GenFw
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-02-17 16:57:44 +0800
committerHao Wu <hao.a.wu@intel.com>2016-02-24 15:31:42 +0800
commite49bfe75abda5a2070ff6d9f9a0a4a1e57dad078 (patch)
tree17b9dbbf49eb1df29544d08b213e11e360e028c5 /BaseTools/Source/C/GenFw
parentca8c81a859ea65df818cb34fa0c73911f031aafb (diff)
downloadedk2-platforms-e49bfe75abda5a2070ff6d9f9a0a4a1e57dad078.tar.xz
BaseTools/GenFw: Fix a bug for GCC build
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> (cherry picked from commit a754c70ceec880038f0e61e413398e96468b34f1)
Diffstat (limited to 'BaseTools/Source/C/GenFw')
-rw-r--r--BaseTools/Source/C/GenFw/Elf32Convert.c3
-rw-r--r--BaseTools/Source/C/GenFw/Elf64Convert.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c b/BaseTools/Source/C/GenFw/Elf32Convert.c
index d115291b06..8fca7fba2a 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -314,7 +314,8 @@ GetSymName (
UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;
bool foundEnd = false;
- for (UINT32 i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {
+ UINT32 i;
+ for (i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {
foundEnd = StrtabContents[i] == 0;
}
assert(foundEnd);
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 3b5f630103..024a2a0d53 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -306,7 +306,8 @@ GetSymName (
UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;
bool foundEnd = false;
- for (UINT32 i = Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {
+ UINT32 i;
+ for (i= Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {
foundEnd = StrtabContents[i] == 0;
}
assert(foundEnd);