Skip to content

Compiler support errors are inconvenient #544

Description

@1Hyena

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions