From owner-freebsd-bugs@FreeBSD.ORG Sat Jun 28 03:40:14 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F266E37B401 for ; Sat, 28 Jun 2003 03:40:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E09D843FF9 for ; Sat, 28 Jun 2003 03:40:12 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5SAeCUp019982 for ; Sat, 28 Jun 2003 03:40:12 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5SAeCVO019981; Sat, 28 Jun 2003 03:40:12 -0700 (PDT) Resent-Date: Sat, 28 Jun 2003 03:40:12 -0700 (PDT) Resent-Message-Id: <200306281040.h5SAeCVO019981@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael van Elst Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C72E837B401 for ; Sat, 28 Jun 2003 03:30:49 -0700 (PDT) Received: from dv2.dev.de.cw.net (dv2.dev.de.cw.net [141.1.23.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A91543FBF for ; Sat, 28 Jun 2003 03:30:48 -0700 (PDT) (envelope-from mlelstv@dv2.dev.de.cw.net) Received: from dv2.dev.de.cw.net (localhost [127.0.0.1]) by dv2.dev.de.cw.net (8.12.9/8.12.6) with ESMTP id h5SAU5C2035789 for ; Sat, 28 Jun 2003 12:30:46 +0200 (CEST) (envelope-from mlelstv@dv2.dev.de.cw.net) Received: (from mlelstv@localhost) by dv2.dev.de.cw.net (8.12.9/8.12.9/Submit) id h5RARCOs099736; Fri, 27 Jun 2003 12:27:12 +0200 (CEST) Message-Id: <200306271027.h5RARCOs099736@dv2.dev.de.cw.net> Date: Fri, 27 Jun 2003 12:27:12 +0200 (CEST) From: Michael van Elst To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/53870: C++ undeclares standard math functions like isinf() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Michael van Elst List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2003 10:40:14 -0000 >Number: 53870 >Category: bin >Synopsis: C++ undeclares standard math functions like isinf() >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 28 03:40:11 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Michael van Elst >Release: FreeBSD 5.1-CURRENT i386 >Organization: dis- >Environment: System: FreeBSD dv2.dev.de.cw.net 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Tue Jun 10 14:12:43 CEST 2003 root@dv2.dev.de.cw.net:/usr/src/sys/i386/compile/DV2 i386 >Description: The following C++ program does not compile on FreeBSD5.* #include void foo() { double d; isinf(d); } The error message is: c.cc: In function `void foo()': c.cc:5: error: `isinf' undeclared (first use this function) c.cc:5: error: (Each undeclared identifier is reported only once for each function it appears in.) This is caused by isinf() being a macro defined in math.h which is then undef'd in the cmath header. The compiler _should_ then see the underlying function implementation instead of the macro. The same is true for some other functions declared in the near vicinity: isinf() isnan() signbit() and some others like fpclassify() and isfinite(). The latter however do not exists as functions in libc. The error appeared with the introduction of GCC3.3. >How-To-Repeat: See above >Fix: Add prototypes for isinf(), isnan(), signbit() functions to math.h. Add function implementations for the other functions that are only macros. >Release-Note: >Audit-Trail: >Unformatted: