Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYLE: Variable set but not used suppression #4978

Merged

Conversation

hjmjohnson
Copy link
Member

ITK/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx:579:10: warning: variable 'chebycoefs0' set but not used [-Wunused-but-set-variable]

PR Checklist

@hjmjohnson hjmjohnson added type:Compiler Compiler support or related warnings type:Style Style changes: no logic impact (indentation, comments, naming) labels Nov 21, 2024
@hjmjohnson hjmjohnson added this to the ITK 6.0 Beta 1 milestone Nov 21, 2024
@hjmjohnson hjmjohnson self-assigned this Nov 21, 2024
@github-actions github-actions bot added area:Numerics Issues affecting the Numerics module and removed type:Compiler Compiler support or related warnings labels Nov 21, 2024
Comment on lines 579 to 581
double chebycoefs0 = 0.0; // the constant term
double datatotal = 0.0;
double a0norm = 1.0;
// NOT USED double chebycoefs0 = 0.0; // the constant term
// NOT USED double datatotal = 0.0;
// NOT USED double a0norm = 1.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

If those variables are really useless, please consider simply removing those lines of code, instead of just commenting them out. 🙏

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Restoring the variables is easy with versioned history, if it is ever needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the comment-out code might actually please the spell checker at the CI, which specifically checks comments! It now complains, saying:

itkFEMImageMetricLoad.hxx  line: 580  word: datatotal

ITK/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx:579:10: warning: variable 'chebycoefs0' set but not used [-Wunused-but-set-variable]
@hjmjohnson hjmjohnson force-pushed the remove-unused-variables branch from 4e89b42 to 3e73585 Compare November 22, 2024 00:48
Copy link
Contributor

@N-Dekker N-Dekker left a comment

Choose a reason for hiding this comment

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

Thanks, Hans!

@N-Dekker N-Dekker merged commit 90a18eb into InsightSoftwareConsortium:master Nov 22, 2024
17 checks passed
@hjmjohnson hjmjohnson deleted the remove-unused-variables branch November 26, 2024 03:44
@hjmjohnson hjmjohnson restored the remove-unused-variables branch November 26, 2024 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Numerics Issues affecting the Numerics module type:Style Style changes: no logic impact (indentation, comments, naming)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants