Opened 8 years ago

Closed 5 years ago

#7396 closed bug (fixed)

C++ std::isnan, std::isinf not working

Reported by: Pinaraf Owned by: axeld
Priority: normal Milestone: R1
Component: System/libroot.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

Hi

I tried to compile QJson but compilation failed with a problem when calling std::isnan or std::isinf.

The error message : "expected unqualified-id before '(' token"

I'll send a really simple test code for this bug that works perfectly with g++ 4.3, 4.4 or 4.5 on debian, but fails with g++ 4.4.4 on Haiku.

Attachments (2)

test.cpp (109 bytes) - added by Pinaraf 8 years ago.
Simple not-compiling source code
fix_stdisnan.patch (5.3 KB) - added by pulkomandy 5 years ago.
Patch adding missing functions to cmath.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Pinaraf

Attachment: test.cpp added

Simple not-compiling source code

comment:1 Changed 8 years ago by kaliber

To fix this, we need to implement some C99 macros in math.h (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered) first and rebuild the toolchain - ticket #7007. After that cmath (gcc4) should contain correct implementation.

comment:2 Changed 5 years ago by korli

I hit this bug when building sci-libs/geos on Haikuports.

Changed 5 years ago by pulkomandy

Attachment: fix_stdisnan.patch added

Patch adding missing functions to cmath.

comment:3 Changed 5 years ago by pulkomandy

Has a Patch: set

comment:4 Changed 5 years ago by pulkomandy

Hi, I attached a patch but I would like it to be reviewed before I push it.

It doesn't break the gcc2 build, at least, and should fix the issue.

comment:5 Changed 5 years ago by pulkomandy

Resolution: fixed
Status: newclosed

Applied the patch in hrev48391.

Note: See TracTickets for help on using tickets.