From owner-freebsd-bugs@FreeBSD.ORG Sun Jun 29 22:21:29 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABED937B401 for ; Sun, 29 Jun 2003 22:21:29 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 077FE43FA3 for ; Sun, 29 Jun 2003 22:21:29 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h5U5LMiP076822; Sun, 29 Jun 2003 22:21:22 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h5U5KlQk076821; Sun, 29 Jun 2003 22:20:47 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 29 Jun 2003 22:20:46 -0700 From: David Schultz To: Michael van Elst Message-ID: <20030630052046.GA76710@HAL9000.homeunix.com> Mail-Followup-To: Michael van Elst , freebsd-bugs@freebsd.org References: <200306281110.h5SBAFm8028260@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306281110.h5SBAFm8028260@freefall.freebsd.org> cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/53870: C++ undeclares standard math functions like isinf() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2003 05:21:30 -0000 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 > To: Artem 'Zazoobr' Ignatjev > 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 > > Add: > > using namespace std; > > Thanks, this helps. Can you explain why this is necessary for isinf() > but not for functions like sin() ? 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 is a bug in libstdc++. If you use '#include ' 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.