[Webkit-unassigned] [Bug 59249] Colliding isinf/isnan between C99 and C++0x with GCC 4.6.0

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 4 16:26:15 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=59249


Alexis Menard <alexis.menard at openbossa.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexis.menard at openbossa.org




--- Comment #10 from Alexis Menard <alexis.menard at openbossa.org>  2011-05-04 16:26:15 PST ---
(In reply to comment #8)
> (From update of attachment 90792 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=90792&action=review
> 
> >>> Source/JavaScriptCore/ChangeLog:9
> >>> +        used, since it can lead to ambiguity in C++0x compilers. See the
> >> 
> >> This is not a very maintainable rule, and following it makes the code base less consistent. I hope that there is a better solution.
> >> 
> >> Is this a gcc bug, or expected behavior?
> > 
> > I can't really think of any, but there might be. My proposed long-term solution of getting rid of math.h and always using std:: in front of the functions also requires not to use "using namespace std;", at least in the files where isnan/isinf are called, so it wouldn't be a huge improvement in that regard, I suppose.
> 
> The right thing to do is to find a fix in MathExtras.h. The goal is to be able to call isinf and isnan directly; there must be way to do that.
> 
> Please do *not* start making these changes to all the files using MathExtras.h.

Hi Darin,

If you look at my approach it limits the modifications but there is still an issue.

I have to specify std in some places otherwise I have :

../../../webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1109:21: error: call of overloaded 'isnan(double&)' is ambiguous
../../../webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1109:21: note: candidates are:
/usr/include/bits/mathcalls.h:235:12: note: int isnan(double)
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/cmath:558:3: note: bool std::isnan(long double)
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/cmath:554:3: note: bool std::isnan(double)
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/cmath:550:3: note: bool std::isnan(float)

because /usr/include/bits/mathcalls.h:235:12: note: int isnan(double) is in the global namespace and in a if condition it becomes ambiguous.

Btw I didn't bother doing a changelog.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list