Date: Fri, 27 Jun 2003 12:27:12 +0200 (CEST) From: Michael van Elst <mlelstv@dev.de.cw.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/53870: C++ undeclares standard math functions like isinf() Message-ID: <200306271027.h5RARCOs099736@dv2.dev.de.cw.net> Resent-Message-ID: <200306281040.h5SAeCVO019981@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <cmath> 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306271027.h5RARCOs099736>