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

[TMVA] Work around warning about unused variables #13837

Merged

Conversation

dpiparo
Copy link
Member

@dpiparo dpiparo commented Oct 10, 2023

This PR implements the same functionality of #13835, but without using cpp17 functionality.

@dpiparo dpiparo self-assigned this Oct 10, 2023
@phsft-bot
Copy link
Collaborator

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac11/noimt, mac12arm/cxx20, windows10/default
How to customize builds

@@ -205,6 +205,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>
}
}
assert(ndims <= 2 && shape.size() > 1); // to support shape cases {n,1}
(void) ndims; // avoid warning about unused variable
Copy link
Member

Choose a reason for hiding this comment

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

See #13836 (comment)

Side note:

Suggested change
(void) ndims; // avoid warning about unused variable
(void) sizeof(ndims); // avoid warning about unused variable

is a more generic version of the pattern used here with a guarantee of no side effect no matter what the type of the variable is.

@dpiparo dpiparo merged commit 7bc2aab into root-project:v6-28-00-patches Oct 10, 2023
@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

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.

3 participants