Bug 258394 - archivers/upx: fix build with clang 13
Summary: archivers/upx: fix build with clang 13
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Max Khon
Depends on:
Blocks: 258209
  Show dependency treegraph
Reported: 2021-09-09 19:18 UTC by Dimitry Andric
Modified: 2021-09-09 19:19 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (fjoe)

Fix unused-but-set variable in upx (703 bytes, patch)
2021-09-09 19:18 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2021-09-09 19:18:08 UTC
During an exp-run for llvm 13 (see bug 258209), it turned out that archivers/upx fails to build with clang 13 [1]:

p_wcle.cpp:739:27: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned count,object,n,r;
1 error generated.

This is because clang 13 now has a -Wunused-but-set-variable warning similar to gcc's, and it is enabled under -Wall.

The p_wcle.cpp file has two instances where the 'n' variable is used for debugging purposes, but the first instance is marked with UNUSED(n). The second is not, triggering this warning.

[1] http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/upx-3.95.log
Comment 1 Dimitry Andric freebsd_committer 2021-09-09 19:18:47 UTC
Created attachment 227794 [details]
Fix unused-but-set variable in upx