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

cassert error #1076

Closed
sburnwal opened this issue May 3, 2018 · 2 comments
Closed

cassert error #1076

sburnwal opened this issue May 3, 2018 · 2 comments
Labels
solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)

Comments

@sburnwal
Copy link

sburnwal commented May 3, 2018

Bug Report

  • What is the issue you have?
    I know you have mentioned that this json lib works great with gcc 4.9. However, my project is big and it uses gcc 4.8 which is not easy to migrate to 4.9. When I write a small program, it works great. I can test json sample programs as you have mentioned in documentation. However, I want to use it in my project that is gcc 4.8.2 based. I took off the gcc 9 check from json.hpp and compiled fine and ran some tests that was all fine. But once in my poroject, my build does not go through. It gives this error:
In file included from /usr/include/c++/4.8.2/cassert:43:0,
 from ../security/src/libjwt/include/jwt/json.hpp:34,

At line 34 in json.hpp: 
   32 #include <algorithm> // all_of, copy, fill, find, for_each, none_of, remove, reverse, transform
   33 #include <array>   // array
   34 #include <cassert> // assert
   35 #include <cctype>  // isdigit

../security/src/libjwt/include/jwt/json.hpp:6055:31:   required from ‘static nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer> nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parse(IteratorType, IteratorType, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parser_callback_t) [with IteratorType = const char*; typename std::enable_if<std::is_base_of<std::random_access_iterator_tag, typename std::iterator_traits<_II1>::iterator_category>::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parser_callback_t = std::function<bool(int, nlohmann::basic_json<>::parse_event_t, nlohmann::basic_json<>&)>]’

../security/src/libjwt/include/jwt/json.hpp:11764:40:   required from here
../security/src/libjwt/include/jwt/json.hpp:1579:19: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [-Werror]
     assert(object != nullptr);

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
    Sorry, I cannot myself repro it but want to know if anyone has faced it and what is the likely way to get out of it ? Any hint would be helpful.

  • What is the expected behavior?
    Compilation should succeed.

  • And what is the actual behavior instead?
    Compilation error.

  • Which compiler and operating system are you using? Is it a supported compiler?

  • Did you use a released version of the library or the version from the develop branch?

  • If you experience a compilation error: can you compile and run the unit tests?

@nlohmann
Copy link
Owner

nlohmann commented May 3, 2018

Maybe #212 could be helpful. Apart from this, I am afraid that sooner or later you will always hit a part of the compiler/STL that is not C++11 compliant.

@nlohmann nlohmann added the solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) label May 4, 2018
@nlohmann
Copy link
Owner

I'm closing this, as supporting GCC 4.8 is not a goal of this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)
Projects
None yet
Development

No branches or pull requests

2 participants