Reviewed-by: Liming Gao <liming....@intel.com> -----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; -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel