Skip to content

Conversation

@guitargeek
Copy link
Contributor

As noted in d008860, using abs() without std:: can be very dangerous because there might be no overload for floating point numbers.

To make sure that no bugs associated to this can happen, I suggest to avoid using abs() without std:: all the way in RooFit.

Also, to go with modern C++ all the way, the occurences of fabs() and std::fabs() are also replaced with std::abs().

As noted in d008860, using `abs()` without `std::` can be very dangerous
because there might be no overload for floating point numbers.

To make sure that no bugs associated to this can happen, I suggest to
avoid using `abs()` without `std::` all the way in RooFit.

Also, to go with modern C++ all the way, the occurences of `fabs()` and
`std::fabs()` are also replaced with `std::abs()`.
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu18.04/nortcxxmod.
Running on sft-ubuntu-1804-3.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.660Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.915Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.915Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:03:31.915Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]

And 60 more

Failing tests:

@phsft-bot
Copy link

Build failed on mac12/noimt.
Running on macphsft18.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-08T13:08:19.369Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:19.369Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:19.369Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:23.950Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:23.950Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:24.212Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:24.213Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:24.213Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:24.213Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:08:24.213Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]

And 53 more

Failing tests:

@phsft-bot
Copy link

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-08T13:40:39.410Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:40:41.217Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:40:41.475Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:40:41.475Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RNTupleDS.hxx:96:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:40:41.476Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RNTupleDS.hxx:98:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T13:40:53.876Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:40:56.272Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:40:56.272Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RSqliteDS.hxx:118:81: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:40:56.560Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RNTupleDS.hxx:97:86: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-08T13:40:56.560Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RNTupleDS.hxx:99:47: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]

And 130 more

Failing tests:

@phsft-bot
Copy link

Build failed on mac11/cxx14.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-08T15:25:57.994Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:25:57.994Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:25:57.994Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:04.081Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:05.374Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:07.092Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:07.092Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:07.362Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:09.453Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-08T15:26:10.024Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]

And 54 more

Failing tests:

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

LGTM!
We should probably make sure that the header <cmath> is included where std::abs is used.

@guitargeek guitargeek merged commit c41cacb into root-project:master Jan 9, 2023
@guitargeek guitargeek deleted the stdabs branch January 9, 2023 10:31
@guitargeek
Copy link
Contributor Author

Yes you're right. It's probably alright because the CI is passing, but I'll verify that later

@phsft-bot
Copy link

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

Errors:

  • [2023-01-09T21:51:16.515Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1138 (message):

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants