Bug 244636

Summary: archivers/upx: Fix build with clang 10.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Max Khon <fjoe>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (fjoe)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Adjust indentation in upx's LZMA parts none

Description Dimitry Andric freebsd_committer freebsd_triage 2020-03-06 17:28:33 UTC
Created attachment 212196 [details]
Adjust indentation in upx's LZMA parts

As reported in bug 244251, with clang 10.0.0 the print/libraqm port runs into a -Werror warning:

In file included from compress_lzma.cpp:305:
./../src/lzma-sdk/C/7zip/Compress/LZMA/LZMAEncoder.cpp:971:9: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
        {
        ^
./../src/lzma-sdk/C/7zip/Compress/LZMA/LZMAEncoder.cpp:967:7: note: previous statement is here
      if (repIndex == 0)
      ^

The strange indentation is caused by a commented out if statement, which the 7-Zip author seems to be fond of.  Newer LZMA SDK drops have a totally different code structure, so I could not find any upstream commit that fixes this.

Therefore, I suggest to just shift the opening brace a bit to shut up the warning.
Comment 1 commit-hook freebsd_committer freebsd_triage 2020-03-17 17:46:43 UTC
A commit references this bug:

Author: fjoe
Date: Tue Mar 17 17:45:47 UTC 2020
New revision: 528589
URL: https://svnweb.freebsd.org/changeset/ports/528589

Log:
  Fix build with clang 10

  PR:		244636
  Submitted by:	Dimitry Andric

Changes:
  head/archivers/upx/files/patch-src_lzma-sdk_C_7zip_Compress_LZMA_LZMAEncoder.cpp