summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/GenFw/Elf32Convert.c
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-02-17 16:57:44 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-02-18 11:25:54 +0800
commita754c70ceec880038f0e61e413398e96468b34f1 (patch)
tree05ad0330d75f416795a0195079a227023df91f9e /BaseTools/Source/C/GenFw/Elf32Convert.c
parentaae1a87555ed4a433fdf980085aa6e73ae27c576 (diff)
downloadedk2-platforms-a754c70ceec880038f0e61e413398e96468b34f1.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>
Diffstat (limited to 'BaseTools/Source/C/GenFw/Elf32Convert.c')
-rw-r--r--BaseTools/Source/C/GenFw/Elf32Convert.c3
1 files changed, 2 insertions, 1 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);