This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: namespace std
- To: jarausch at IGPM dot Rwth-Aachen dot DE
- Subject: Re: namespace std
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 22 Sep 1998 09:09:25 +0200
- CC: egcs-bugs at cygnus dot com
- References: <jarausch-980921121837.A07620@numa1>
> using egcs-1.1a, I can't get the declarations in <math.h> into
> namespace std even if using -fhonor-std
This is because g++ has builtin definitions of the math.h functions in
::. When I compile
namespace std{
#include <math.h>
}
main()
{
sqrt(9.0);
}
with
g++ -fhonor-std -fno-builtin d.cc -o d
I get
d.cc: In function `int main()':
d.cc:7: warning: implicit declaration of function `int sqrt(...)'
When I compile
namespace std{
#include <math.h>
}
main()
{
std::sqrt(9.0);
}
instead, it compiles. The real fix, of course, is that the builtin
functions should be in std:: if it is honored. Thanks for your report.
Hope this helps,
Martin