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

COMP: Remove unused topCluster var from FiberTractMeasurements #220

Merged
merged 1 commit into from Dec 7, 2023

Conversation

jhlegarreta
Copy link
Contributor

@jhlegarreta jhlegarreta commented Nov 15, 2023

Fix the unused topCluster variable warning in FiberTractMeasurements: remove the variable.

The topCluster variable was originally introduced in 798a1e5 and its use became no longer necessary in 9bdd1d3, where it was left behind.

Fixes:

Modules/CLI/FiberTractMeasurements/FiberTractMeasurements.cxx:563:10:
 warning: variable ‘topCluster’ set but not used [-Wunused-but-set-variable]
     bool topCluster = true;
          ^~~~~~~~~~

reported on the 3D Slicer CDash server in the context of preview builds on CentOS 7 with GCC 7:
https://slicer.cdash.org/viewBuildError.php?type=1&buildid=3210886

Copy link
Contributor

@jcfr jcfr left a comment

Choose a reason for hiding this comment

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

The ivar topCluster was originally introduced in 798a1e5 (ENH: FBTractMeasurement: by default, print only specified hierarchy.) and became obsolete in 9bdd1d3 (FBTractMsr: correctly fix #36: by default print top and cluster groups, but not fiberbundles).

Consider removing the lines instead of commenting.

@jcfr jcfr changed the title COM: Fix unused variable warning COMP: Fix unused variable warning Nov 16, 2023
@jcfr
Copy link
Contributor

jcfr commented Nov 16, 2023

Suggested commit message:

COMP: Remove unused topCluster ivar from FiberTractMeasurements

The topCluster variable was originally introduced in
798a1e5 (ENH: FBTractMeasurement: by default, print only specified hierarchy.)
and became obsolete in 9bdd1d3 (FBTractMsr: correctly fix #36: by default print
top and cluster groups, but not fiberbundles).

Fixes:
```
Modules/CLI/FiberTractMeasurements/FiberTractMeasurements.cxx:563:10:
 warning: variable ‘topCluster’ set but not used [-Wunused-but-set-variable]
     bool topCluster = true;
          ^~~~~~~~~~
```

@jhlegarreta jhlegarreta changed the title COMP: Fix unused variable warning COMP: Remove unused topCluster var from FiberTractMeasurements Nov 16, 2023
@jcfr
Copy link
Contributor

jcfr commented Nov 16, 2023

I suggest to avoid including the following in the commit message:

raised for example in:
https://slicer.cdash.org/viewBuildError.php?type=1&buildid=3210886

Since the buildid corresponding to 3210886 will be invalid a few months, I suggest to reference it only in the pull request or issue.

@jhlegarreta
Copy link
Contributor Author

I suggest to avoid including the following in the commit message:
Since the buildid corresponding to 3210886 will be invalid a few months, I suggest to reference it only in the pull request or issue.

I am aware of that, but for the moment when/few weeks around a commit tries to address an issue, to me it is essential that we can openly see which the issue is or where it has been observed. And I dislike using GitHub comments to mention things that are integral to the history of the code, as we cannot see them in the git history.

@jcfr
Copy link
Contributor

jcfr commented Nov 16, 2023

it is essential that we can openly see which the issue is or where it has been observed

Indeed, my understanding is that the warning copied in the commit message fulfills this role providing the context and the exact same information that is reported on CDash.

In practice, adding the a CDash link that becomes obsolete will mislead developers ...(Why is the link not working ? Is the server broken ? ...)

Adding something like this would be much more explicit:

Fixes the following warning reported on the Slicer CDash server in the
context of "preview" build done on Centos 7 with GCC 7:
...

@jhlegarreta
Copy link
Contributor Author

I prefer to keep the link and be open about the context and reproducibility of the error. It is helpful at the time of reviewing a PR.

@jcfr
Copy link
Contributor

jcfr commented Nov 16, 2023

In the commit message, I then suggest to include something like this:

Fixes the following warning reported on the Slicer CDash server in the
context of "preview" build done on Centos 7 with GCC 7:

```
Modules/CLI/FiberTractMeasurements/FiberTractMeasurements.cxx:563:10:
 warning: variable ‘topCluster’ set but not used [-Wunused-but-set-variable]
     bool topCluster = true;
          ^~~~~~~~~~
```

it is helpful at the time of reviewing a PR.

Exactly, while submitting the PR you then add a line like:

The warning fixed by this pull-request was reported at https://slicer.cdash.org/viewBuildError.php?type=1&buildid=3210886

Fix the unused `topCluster` variable warning in
`FiberTractMeasurements`: remove the variable.

The `topCluster` variable was originally introduced in 798a1e5 and its
use became no longer necessary in 9bdd1d3, where it was left behind.

Fixes:
```
Modules/CLI/FiberTractMeasurements/FiberTractMeasurements.cxx:563:10:
 warning: variable ‘topCluster’ set but not used [-Wunused-but-set-variable]
     bool topCluster = true;
          ^~~~~~~~~~
```

reported on the 3D Slicer CDash server in the context of `preview`
builds on CentOS 7 with GCC 7:
https://slicer.cdash.org/viewBuildError.php?type=1&buildid=3210886
@jhlegarreta
Copy link
Contributor Author

Warnings are gone; test failures are expected.

@ljod ljod merged commit 5838d08 into SlicerDMRI:master Dec 7, 2023
1 check failed
@jhlegarreta jhlegarreta deleted the FixUnusedVariableWarning branch December 7, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants