Skip to content
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

Compiler support errors are inconvenient #544

Closed
1Hyena opened this issue Apr 1, 2017 · 2 comments
Closed

Compiler support errors are inconvenient #544

1Hyena opened this issue Apr 1, 2017 · 2 comments

Comments

@1Hyena
Copy link

1Hyena commented Apr 1, 2017

Instead of whitelisting compilers you should blacklist them. What's the point of compiler whitelisting anyway? Shouldn't the code be portable in the first place?
This is my compiler:
g++ (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5

I received the compiler error, I couldn't easily upgrade my compiler because seems that my system uses 4.8.5 by default and getting around it would have required me to change the Makefile of my project which I didn't want to do (to specifically call g++4.9 instead of just g++). So I changed the header file to this

// exclude unsupported compilers
#if defined(__clang__)
    #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
        #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
    #endif
#elif defined(__GNUC__)
    #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
        #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
    #endif
#endif

and everything compiled just fine, I ran my program and it works. Not sure what the big issue is. Why wouldn't nlohmann::json compile correctly with g++ 4.8.5 ???

For the record, I use linux mint 17.1 (is it really obsolete already? I don't think so).

@nlohmann
Copy link
Owner

nlohmann commented Apr 1, 2017

From the page mentioned in the error message:

GCC 4.8 does not work because of two bugs (55817 and 57824) in the C++11 support. Note there is a pull request to fix some of the issues.

The test suite fails to compile with GCC 4.8. Whereas a subset of the features may work, I do not want to provide support for this compiler version.

@1Hyena
Copy link
Author

1Hyena commented Apr 1, 2017

oh ok, C++11 related issues I guess I should really upgrade my compiler then :D

@1Hyena 1Hyena closed this as completed Apr 1, 2017
OKaluza added a commit to lavavu/LavaVu that referenced this issue Sep 1, 2017
Seems to work if we remove this restriction, need further testing
There could be problems if we use certain features of json.hpp
nlohmann/json#544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants