Bug 258397 - biology/jellyfish: fix unused variable warning with clang 13
Summary: biology/jellyfish: fix unused variable warning with clang 13
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jason W. Bacon
URL:
Keywords:
Depends on:
Blocks: 258209
  Show dependency treegraph
 
Reported: 2021-09-09 21:56 UTC by Dimitry Andric
Modified: 2021-09-11 12:34 UTC (History)
0 users

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


Attachments
Fix unused mode variable (900 bytes, patch)
2021-09-09 21:58 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 21:56:32 UTC
During an exp-run for llvm 13 (see bug 258209), it turned out that biology/jellyfish fails to build with clang 13 [1]:

In file included from sub_commands/count_main.cc:38:
In file included from ./include/jellyfish/hash_counter.hpp:16:
./include/jellyfish/dumper.hpp:48:24: error: variable 'mode' set but not used [-Werror,-Wunused-but-set-variable]
    std::ios::openmode mode = std::ios::out;
                       ^
1 error generated.

This is an actual bug: the mode variable is setup in the dumper_t::open_next_file() function, but never used for actually opening the output file.

Fix this by adding the mode argument to the out.open() call.

[1] http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/Jellyfish-2.3.0.log
Comment 1 Dimitry Andric freebsd_committer 2021-09-09 21:58:12 UTC
Created attachment 227798 [details]
Fix unused mode variable
Comment 2 commit-hook freebsd_committer 2021-09-11 12:32:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=696f6acf5df455dddd38a7b023820f5eddcddc60

commit 696f6acf5df455dddd38a7b023820f5eddcddc60
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2021-09-11 12:29:47 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2021-09-11 12:29:47 +0000

    biology/jellyfish: Fix unused open mode variable

    PR:             258397
    Reported by:    dim

 biology/jellyfish/Makefile                                    |  1 +
 .../jellyfish/files/patch-include_jellyfish_dumper.hpp (new)  | 11 +++++++++++
 2 files changed, 12 insertions(+)
Comment 3 Jason W. Bacon freebsd_committer 2021-09-11 12:34:26 UTC
Thanks!