Opened 9 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 9 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)

by Pinaraf, 9 years ago

Attachment: test.cpp added

Simple not-compiling source code

comment:1 by kaliber, 9 years ago

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 by korli, 5 years ago

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

by pulkomandy, 5 years ago

Attachment: fix_stdisnan.patch added

Patch adding missing functions to cmath.

comment:3 by pulkomandy, 5 years ago

Has a Patch: set

comment:4 by pulkomandy, 5 years ago

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 by pulkomandy, 5 years ago

Resolution: fixed
Status: newclosed

Applied the patch in hrev48391.

Note: See TracTickets for help on using tickets.