-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Prevent accidental casting from double to int in xroofit
#11984
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
Conversation
|
Can one of the admins verify this patch? |
guitargeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MrCarroll, thank you very much for your PR!
I think it would be better to address the underlying problem of why it thinks the first argument is an int. My suspicion is that the problem is the usage of abs and not std::abs, because abs has no overload for doubles. By passing a double to abs without std::, it gets rounded to an int depending on your environment. This is a bug that just casting back to double afterwards doesn't fix: you have to use the right std::abs function to begin with.
Can you please check if this makes sense, by trying my suggestion in your snap environment, and if it works update your PR?
Thanks again!
On the Snap build of ROOT, the parameters were assumed to be int, double
|
@phsft-bot build |
|
Starting build on |
guitargeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for the fix!
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Warnings:
And 60 more Failing tests:
|
|
Build failed on mac12/noimt. Warnings:
And 53 more Failing tests:
|
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Warnings:
And 130 more Failing tests:
|
|
Build failed on mac11/cxx14. Warnings:
And 54 more Failing tests:
|
double to int in xroofit
|
Build failed on ROOT-ubuntu2004/python3. Warnings:
|
On the Snap build of ROOT, the parameters were assumed to be int, double
Errors from build log, running Ubuntu 20.04 GCC9 C++17
This doesn't appear to occur in normal builds, but the guard code seems trivial enough to include and this may prevent compilation errors in other scenarios.
Checklist: