Skip to content

conflict between math.h and cmath #318

@talismanbrandi

Description

@talismanbrandi

#include <math.h>

Hi,

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.

thanks!
Ayan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions