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

Compilation "note" on GCC 6 ARM #658

Closed
pn1k opened this issue Jul 16, 2017 · 6 comments
Closed

Compilation "note" on GCC 6 ARM #658

pn1k opened this issue Jul 16, 2017 · 6 comments
Labels
platform: arm related to ARM architecture

Comments

@pn1k
Copy link

pn1k commented Jul 16, 2017

When compiling this code:

#include <iostream>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

int main(int argc, char *argv[]) {
  json o=json::parse("{\"foo\":\"bar\",\"list\":{\"100\":{\"l100\":100},\"200\":{\"l200\":200}}}") ;

  json& l=o["list"];

  for (json::iterator it = l.begin(); it != l.end(); ++it) {
    std::cout << it.key() << " : " << it.value() << "\n";
  }

}

compiler report "note":

In file included from /usr/include/c++/6/map:60:0,
                 from /usr/local/include/nlohmann/json.hpp:50,
                 from test.cpp:2:
/usr/include/c++/6/bits/stl_tree.h: In member function ‘std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >]’:
/usr/include/c++/6/bits/stl_tree.h:1928:5: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >}’ will change in GCC 7.1
     _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@nlohmann
Copy link
Owner

Thanks for reporting. I'm not sure whether this is an issue: we already use GCC 7.1 on Travis, and locally I compile and test with GCC 8.

@pn1k
Copy link
Author

pn1k commented Jul 17, 2017

This "note" happens only on arm-linux-gnueabihf arch (Raspberry Pi) . On the same version of GCC 6 (6.3.0) on x86-64 arch the test code compiles well without any notes. However, compiled code works well on ARM.

This note can be turned off by passing argument '-Wno-psabi' to compiler.

@pn1k pn1k closed this as completed Jul 17, 2017
@nlohmann nlohmann added the platform: arm related to ARM architecture label Oct 24, 2017
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 7, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 9, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 11, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 11, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 14, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 14, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
IgorAnohin pushed a commit to IgorAnohin/Navio2 that referenced this issue Nov 14, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
staroselskii pushed a commit to emlid/Navio2 that referenced this issue Nov 17, 2017
Add new Makefile, which build navio library
Add 'Wno-psabi' flag (nlohmann/json#658)
Add gitignore file
@ghost
Copy link

ghost commented Feb 16, 2019

still broken

@ghost
Copy link

ghost commented Feb 16, 2019

same thing on 8.1

@jaredgrubb
Copy link
Contributor

The "note: parameter passing for argument of type ... will change in GCC 7.1" is an internal note about internal data types to the STL and doesn't seem to have anything to do with nlohmann json.

Maybe you are mixing versions of libstdc++ and GCC that are not meant to be used together? I would check how your compiler is finding your STL. If you are making your own GCC, maybe you forgot to also build a compatible version of libstdc++ and you're getting a system one or seomthing?

@ghost
Copy link

ghost commented Feb 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: arm related to ARM architecture
Projects
None yet
Development

No branches or pull requests

3 participants