Skip to content

Fixing warning: unused variable - #7375

Open
daavid00 wants to merge 1 commit into
OPM:masterfrom
daavid00:unused
Open

Fixing warning: unused variable#7375
daavid00 wants to merge 1 commit into
OPM:masterfrom
daavid00:unused

Conversation

@daavid00

Copy link
Copy Markdown
Member

Fixing warning: unused variable 'percent'

@daavid00 daavid00 added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Aug 30, 2026

@blattms blattms left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider this warning a false positive as this is a struct (at least if it happens in a header). Here it is in a cpp file and makes a bit more sense, but it assumes that the design of a class is just for the current implementation. That still seems a bit strange.

Comment thread tests/test_tpsa_matrix.cpp Outdated
struct Tolerance<double>
{
static constexpr double percent = 1e-10;
[[maybe_unused]] static constexpr double percent = 1e-10;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is always used.

Comment on lines 82 to 86
template <>
struct Tolerance<float>
{
static constexpr float percent = 1e-3;
[[maybe_unused]] static constexpr float percent = 1e-3;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole specialization will not be used. Hence maybe we should prefer using a surround #if FLOW_INSTANTIATE_FLOAT

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @blattms

@daavid00

Copy link
Copy Markdown
Member Author

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants