You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TMath.h contains an inclusion of cmath. Including math.h after including TMath.h seems unnecessary. Also, it creates an error with some compilers, e.g. GCC 7.3.0.
In file included from BCMath.cxx:21:0:
/Users/ayanpaul/opt/local/include/c++/7.3.0/math.h:66:12: error: ‘constexpr bool std::isnan(double)’ conflicts with a previous declaration
using std::isnan;
^~~~~
In file included from BCMath.cxx:17:0:
/Users/ayanpaul/opt/local/include/TMath.h:407:19: note: previous declaration ‘int isnan(double)’
extern int isnan(double);
The code compiles just fine without the inclusion of math.h.
Activity
oschulz commentedon Apr 7, 2019
Thanks for reporting this! We should indeed
#include <cmath>. It should be included explicitly though, we shouldn't rely on indirect includes.talismanbrandi commentedon Apr 8, 2019
Thanks for looking into this. Including cmath indeed solves the problem the way you want to.
fredRos commentedon Apr 9, 2019
@oschulz Would be great to use g++7.3 in our automated testing to really make sure this problem is fixed. Who can open a PR for the fix itself?
fredRos commentedon Apr 9, 2019
I guess we can update our ubuntu container to use the latest g++ like this
from https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
fixes issue bat#318 in bat/bat
fixes issue bat#318 in bat/bat
Include cmath instead of math.h
oschulz commentedon Apr 10, 2019
Closed by #321