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>
This commit is contained in:
Yonghong Zhu 2016-02-17 16:57:44 +08:00
parent aae1a87555
commit a754c70cee
2 changed files with 4 additions and 2 deletions

View File

@ -314,7 +314,8 @@ GetSymName (
UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset; UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;
bool foundEnd = false; 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; foundEnd = StrtabContents[i] == 0;
} }
assert(foundEnd); assert(foundEnd);

View File

@ -306,7 +306,8 @@ GetSymName (
UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset; UINT8* StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;
bool foundEnd = false; 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; foundEnd = StrtabContents[i] == 0;
} }
assert(foundEnd); assert(foundEnd);