Bug 3344 - 10.3.9 Build Failure: isnan failure in kjs_window.cpp
Summary: 10.3.9 Build Failure: isnan failure in kjs_window.cpp
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 412
Hardware: Mac OS X 10.3
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks: 3354
  Show dependency treegraph
 
Reported: 2005-06-08 04:17 PDT by Christopher Schmidt
Modified: 2006-01-30 03:18 PST (History)
2 users (show)

See Also:


Attachments
proposed fix (785 bytes, patch)
2005-06-13 18:41 PDT, Finlay Dobbie
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Schmidt 2005-06-08 04:17:06 PDT
Another build error: in file:
/Users/crschmidt/webkit/WebCore/khtml/ecma/kjs_window.cpp

/Users/crschmidt/webkit/WebCore/khtml/ecma/kjs_window.cpp:93: error: `isnan' not
declared
/Users/crschmidt/webkit/WebCore/khtml/ecma/kjs_window.cpp: In function `int
KJS::intFeature(const QMap<QString, QString>&, const char*, int, int, int)':
/Users/crschmidt/webkit/WebCore/khtml/ecma/kjs_window.cpp:557: error: `isnan'
undeclared (first use this function)
/Users/crschmidt/webkit/WebCore/khtml/ecma/kjs_window.cpp:557: error: (Each
undeclared identifier is reported only once for each function it appears in.)

Interestingly enough, there seems to be some kind of indication in the file of
why this might happen: 

// Must include <cmath> instead of <math.h> because of a bug in the
// gcc 3.3 library version of <math.h> where if you include both
// <cmath> and <math.h> the macros necessary for functions like
// isnan are not defined.

But <cmath> is being included. Not sure why exactly this is/isn't working, but I
do know that Panther is using gcc-3.3, whereas building on Tiger used gcc-4.0.

This one is an error, rather than a warning, so it can't be just skipped over.

I was able to continue building by pulling the isnan calls out (as well as the
using std::isnan), although obviously the code in this file will suffer as a
result. (Not sure what the end result of this really is, just trying to get it
to build to find where things which need to change are).

(Brought over from Bug 3331).
Comment 1 Robin Lu 2005-06-08 20:08:02 PDT
I worked it around by applying this:

-using std::isnan;
+extern "C" int isnan(double);
Comment 2 Christopher Schmidt 2005-06-08 20:20:20 PDT
Confirmed: Robin's fix allows the file to build correctly.
Comment 3 Finlay Dobbie 2005-06-13 18:41:04 PDT
Created attachment 2308 [details]
proposed fix
Comment 4 Harri Porten 2005-06-16 14:47:17 PDT
FWIW, the KDE version already uses an easy fix for this problem. The code is 
#ifdefed with HAVE_FLOAT_H. It's just that it's also protected 
by !APPLE_CHANGES so I think all that's needed is to apply the same change to 
operations.h. 
Comment 5 Darin Adler 2005-06-18 16:53:21 PDT
Comment on attachment 2308 [details]
proposed fix

I don't like solutions that involve changing the project file, because it makes
it likely that we'll never remember to remove the hack. Also, setting the
internal _GLIBCPP flag in the project file is not how the library's intended to
be used.

There must be some other solution to compiling this on Panther. I'd prefer
another approach.

If we search and can't come up with anything, then feel free to set the review
flag on this patch again and I'll reconsider.
Comment 6 Finlay Dobbie 2005-06-18 16:57:10 PDT
This solution is the one that the Xcode Tools team suggested, fwiw.
Comment 7 Finlay Dobbie 2005-06-18 17:04:05 PDT
(In reply to comment #6)
> This solution is the one that the Xcode Tools team suggested, fwiw.

Just to clarify: this suggestion was made by Chris Espinosa and seemingly endorsed by Scott Tooker on 
the xcode-users mailing list, and not necessarily the position of the Xcode Tools team. See http://
lists.apple.com/archives/xcode-users/2005/May/msg00765.html
Comment 8 Darin Adler 2005-09-11 22:05:51 PDT
I think this is fixed in TOT.
Comment 9 Maciej Stachowiak 2006-01-30 03:18:11 PST
Seems to work ok on TOT.