-
Notifications
You must be signed in to change notification settings - Fork 2.7k
isfinite compilation error #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is the gcc version you are using? Is it possible that you are a victim of this error: https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/512741 |
Interesting find, wasn't aware of that. My GCC version is 4.8.2.
Also, running the test program mentioned in the bug report does not give the failed result for me so I believe I am safe from that GCC bug:
I always got the |
I partially can understand the problem now and there is a simple reproducer for this:
This leads to the same kind of error that you observed and this looks like a compiler defect to me. But there is a simple workaround for this. Instead of using
To make this idiom more manageable, I suggest to add the following inline function to the jsoncpp code:
and to refer to that |
…provide isfinite functionality for Visual Studio compilers as well.
My recent commit (#217) should hopefully resolve the problem. You might want to test it as well. |
Yes I believe that would resolve it. I also have an open pull request for the issue at #215. I'm hoping for some input from @cdunn2001 about the usage of things like What I'd like to see is using the C++ headers everywhere - I'm wondering if there's a reason that this file uses the C style of include or if it just hasn't been switched over yet. I could make those changes if wanted. In its current state I think your pull request is better - however if the preference is to switch this file over to the |
I have studied your pull request but I can ensure you that - albeit it works for recent gcc versions - it would not work for Visual Studio (which depends on
which also relies on remapping |
Can you explain why? I have only added the mapping into namespace Only in the case that we are not Visual Studio and are not Solaris, then I map |
Sorry, I was a bit hasty when arguing about your resolution. It fixes the problem for the sun case as well, but it does not activate the isfinite mapping for Visual Studio (That is one relevant side aspect of my own pull request). At the very moment the difference doesn't matter much, but the |
There are two separate issues at play. The issue I solved was to make the current code work and to defer to a well-defined Personally I still think the file should be pulling in Although functionally your method of |
It's historical. However, I always worry about breaking users with old compilers. Ideally, the older branch will not include these new features. I'm fine with All the |
So is the intention here to break compatibility with Visual Studio including VS 2012? Because that will be the result when following your directions exactly, because even though VS 2012 provides header |
I agree. We want VS2012 to work with the master branch. |
@Dani-Hub, I am confused about your opposition to including As far as I can tell, every option discussed would maintain the entire functionality of your pull request, if not slightly different aesthetically. |
My concerns had always been regarding breaking support for VS 2012, and not specifically against including I have two concerns with the recently provided patch:
Yesterday I found the finally Visual Studio 2013 will provide support for
instead.
should not include That being said, if I above changes would be applied, the patch looks good to me. |
I've incorporated the suggested changes into #218, and fixed my error from the previous commit. |
I like your changes versus |
Dani-Hub, if we need another correction, please submit another PR. You're probably right, but I've lost track of the issues. |
This is on Ubuntu Trusty, failing here (I am using an amalgamated version of SHA ed495ed). For me, replacing
isfinite()
withstd::isfinite()
at that line let me compile. However due to the cross-platform support forisfinite
here this isn't the real solution.The text was updated successfully, but these errors were encountered: