Date: Sun, 29 Jun 2003 22:20:46 -0700 From: David Schultz <das@FreeBSD.ORG> To: Michael van Elst <mlelstv@dev.de.cw.net> Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/53870: C++ undeclares standard math functions like isinf() Message-ID: <20030630052046.GA76710@HAL9000.homeunix.com> In-Reply-To: <200306281110.h5SBAFm8028260@freefall.freebsd.org> References: <200306281110.h5SBAFm8028260@freefall.freebsd.org>
index | next in thread | previous in thread | raw e-mail
On Sat, Jun 28, 2003, Michael van Elst wrote: > The following reply was made to PR bin/53870; it has been noted by GNATS. > > From: Michael van Elst <mlelstv@dev.de.cw.net> > To: Artem 'Zazoobr' Ignatjev <timon@memphis.mephi.ru> > Cc: FreeBSD-gnats-submit@freebsd.org > Subject: Re: bin/53870: C++ undeclares standard math functions like isinf() > Date: Sat, 28 Jun 2003 13:10:08 +0200 > > On Sat, Jun 28, 2003, Artem 'Zazoobr' Ignatjev wrote: > > > > #include <cmath> > > Add: > > using namespace std; > > Thanks, this helps. Can you explain why this is necessary for isinf() > but not for functions like sin() ? <cmath> is supposed to place symbols in the std namespace, not the global namespace. The fact that sin() is put into the global namespace when you include <cmath> is a bug in libstdc++. If you use '#include <math.h>' instead, these symbols *will* wind up in the global namespace, but that approach is deprecated. > The only difference seems to be that isinf() happens to implemented as > a macro (it used to be a function in FreeBSD4). C99 requires it to be a macro, since that's the only way it can correctly accept arguments of multiple types in C.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030630052046.GA76710>
