This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
<math.h>
- To: gcc at gcc dot gnu dot org
- Subject: <math.h>
- From: Magnus Fromreide <magfr at lysator dot liu dot se>
- Date: Fri, 2 Mar 2001 13:56:02 +0100 (MET)
According to 26.5p5 <cmath> contains, among other, the function
double std::abs(double)
D.5p2:
Each C header, whose name has the form name.h, behaves as if each name
placed in the Standard library namespace by the corresponding cname is
also placed within the namespace scope of the namespace std and is
followed by an explicit using-declaration (7.3.3)
Does this, taken together, imply that the call to abs in the program below
calls std::abs(double) ?
If this is the case it seems as if we would have to overload math.h,
otherwise the C++ standard is quite unclear but would probably need to
include that only functions from the C subset should be included.
#include <math.h>
int main()
{
abs(-1.0);
return 0;
}