Hi Laszlo, This patch cause VS2013 make BaseTools failure, please help to check it, thanks.
Sdk\C\LzmaEnc.c(1370) : error C2220: warning treated as error - no 'object' file generated Sdk\C\LzmaEnc.c(1370) : warning C4127: conditional expression is constant NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0 \VC\BIN\cl.exe"' : return code '0x2' Stop. Error while making LzmaCompress! Best Regards, Zhu Yonghong -----Original Message----- From: Laszlo Ersek [mailto:ler...@redhat.com] Sent: Thursday, February 18, 2016 12:32 PM To: Gao, Liming; edk2-devel-01 Cc: Justen, Jordan L; Cole Robinson; Zhu, Yonghong Subject: Re: [PATCH v2] BaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation" On 02/18/16 02:22, Gao, Liming wrote: > Reviewed-by: Liming Gao <liming....@intel.com> Thanks guys; commit 6cc7ada465a7. Laszlo > -----Original Message----- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Thursday, February 18, 2016 3:18 AM > To: edk2-devel-01 <edk2-de...@ml01.01.org> > Cc: Justen, Jordan L <jordan.l.jus...@intel.com>; Cole Robinson > <crobi...@redhat.com>; Gao, Liming <liming....@intel.com>; Zhu, > Yonghong <yonghong....@intel.com> > Subject: [PATCH v2] BaseTools: LzmaCompress: fix gcc-6 warning > "misleading-indentation" > > The way the first use of the "_maxMode" variable is commented out > (i.e., together with the enclosing "if" statement) in GetOptimum() > triggers the "misleading-indentation" warning that is new in gcc-6.0, > for the block of code that originally depended on the "if" statement. > Gcc believes > (mistakenly) that the programmer believes (mistakenly) that the block > depends on (repIndex == 0) higher up. > > Restore the if statement, with a controlling expression that comprises > the constant 1 and "_maxMode" commented out. > > Cc: Jordan Justen <jordan.l.jus...@intel.com> > Cc: Cole Robinson <crobi...@redhat.com> > Cc: Liming Gao <liming....@intel.com> > Cc: Yonghong Zhu <yonghong....@intel.com> > Reported-by: Cole Robinson <crobi...@redhat.com> > Suggested-by: Jordan Justen <jordan.l.jus...@intel.com> > Build-tested-by: Cole Robinson <crobi...@redhat.com> > Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1307439 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek <ler...@redhat.com> > --- > BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c > b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c > index 9b2dd16ffa48..c6717eeea3a0 100644 > --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c > +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c > @@ -1367,7 +1367,7 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, > UInt32 *backRes) > if (repIndex == 0) > startLen = lenTest + 1; > > - /* if (_maxMode) */ > + if (1 /* _maxMode */) > { > UInt32 lenTest2 = lenTest + 1; > UInt32 limit = lenTest2 + p->numFastBytes; > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel