Conversation
6d77082 seems to have not noticed this was already present.
Oddly the warning that led to b726346 did not also warn on this near-identical code. Reported-by: GCC 16.2.1 -Wunused-but-set-variable
Infer says:
[HIGH] common/isa.h:5:35: Function parameter `ptr` is passed by-value
but not modified inside this function, resulting in a potential
unnecessary copy at the function's callsites.
[infer-pulse-const-refable]
template <typename T, typename U> static inline bool isa(const U ptr) {
^
[HIGH] librumur/src/resolve-symbols.cc:648:22: variable `&resolved` is
copied into an intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
if (isa<Range>(resolved)) {
^
These are essentially false positives. None of the copies here are a
significant cost. But we may as well pacify the tool and adhere to
better style.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] rumur/src/generate-print.cc:63:1: Function parameter `width` is
passed by-value but not modified inside this function, resulting in
a potential unnecessary copy at the function's callsites.
[infer-pulse-const-refable]
static std::string derive_handle(const std::string &handle,
^
[HIGH] rumur/src/generate-print.cc:73:70: variable `width` is copied
into an intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
return derive_handle(handle, … width);
^
[HIGH] rumur/src/generate-print.cc:147:64: variable `&w` is copied
into an intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
const std::string ph = derive_handle(previous_handle, o, w);
^
It is unlikely this could lead to any performance issue, but it is a
reasonable point that we do not know the structure of `mpz_class` and
would like to remain agnostic to it.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] rumur/src/generate-print.cc:71:1: Function parameter `offset`
is passed by-value but not modified inside this function, resulting
in a potential unnecessary copy at the function's callsites.
[infer-pulse-const-refable]
static std::string derive_handle(const std::string &handle, …
^
It is unlikely this could lead to any performance issue, but it is a
reasonable point that we do not know the structure of `mpz_class` and
would like to remain agnostic to it.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] rumur/src/generate-print.cc:71:1: Function parameter `width` is
passed by-value but not modified inside this function, resulting in
a potential unnecessary copy at the function's callsites.
[infer-pulse-const-refable]
static std::string derive_handle(const std::string &handle, …
^
It is unlikely this could lead to any performance issue, but it is a
reasonable point that we do not know the structure of `mpz_class` and
would like to remain agnostic to it.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] rumur/src/optimise-field-ordering.cc:13:1: Function parameter
`v` is passed by-value but not modified inside this function,
resulting in a potential unnecessary copy at the function's
callsites. [infer-pulse-const-refable]
static bool is_onehot(mpz_class v) {
^
It is unlikely this could lead to any performance issue, but it is a
reasonable point that we do not know the structure of `mpz_class` and
would like to remain agnostic to it.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] librumur/src/Expr.cc:968:17: variable `&a` is copied into an
intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
return lshift(a, b);
^
[HIGH] librumur/src/Expr.cc:968:20: variable `&b` is copied into an
intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
return lshift(a, b);
^
I would expect all contemporary compilers to be able to see through this
and avoid the copy. But it does not help to give them more explicit
encouragement.
Reported-by: Infer 1.3.0
Infer says:
[HIGH] librumur/src/Expr.cc:1018:17: variable `&a` is copied into an
intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
return rshift(a, b);
^
[HIGH] librumur/src/Expr.cc:1018:20: variable `&b` is copied into an
intermediate and is never modified.
[infer-pulse-unnecessary-copy-intermediate]
return rshift(a, b);
^
I would expect all contemporary compilers to be able to see through this
and avoid the copy. But it does not help to give them more explicit
encouragement.
Reported-by: Infer 1.3.0
Smattr
force-pushed
the
smattr/8dbf2bd7-dae6-498d-902b-3109448c5391
branch
from
September 26, 2026 23:54
0f2bbd3 to
ee2dbba
Compare
Smattr
added a commit
that referenced
this pull request
Sep 27, 2026
CIed in an intermediate state of #360.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.