Coder Social home page Coder Social logo

Comments (6)

SebastianSchildt avatar SebastianSchildt commented on August 24, 2024 1

@rai20 The problem with the -std=c++11 option can be fixed by replacing
add_compile_options(-std=c++11 )
with
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

I am not doing a pull request, because #8 is still an issue, I get the same error. Maybe you can check

from kuksa.apps.

m-lenz avatar m-lenz commented on August 24, 2024

Compilation also yields warnings regarding the GCC-Compiler and the specified flags.

Starting with gcc 7.1 the code won't build anymore, due to outdated allocation-calls.

/usr/include/c++/6.4.0/bits/stl_algobase.h: In function '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = true; _II = jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*; _OI = __gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >]':

Since the current stable release is gcc 8.3 the build-scripts should be updated to conform to modern standards. (~50-100 of these are thrown)

from kuksa.apps.

m-lenz avatar m-lenz commented on August 24, 2024

Also the c++-flag should be disabled, when compiling c. This is a negligible warning, but bloats the logs/std::out/std::err and makes information-extraction very complicated.

[ XY%] Building C object CMakeFiles/paho-lib.dir/app/3rd-party-libs/....c.o cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C

from kuksa.apps.

SebastianSchildt avatar SebastianSchildt commented on August 24, 2024

@argerus The former comment changing the way compile options are set can also make the warnings go away, when building the kuksa-cloud-dashboard

from kuksa.apps.

SebastianSchildt avatar SebastianSchildt commented on August 24, 2024

Update:

No warnings on amd64 (GCC 7.4.0 and 6.4) and and ARM64 (gcc 6.4.0), only arm32v6 (gcc6.4) produces warnings

In file included from /app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json.hpp:24:0,
                 from /app/kuksa-cloud-dashboard/src/main.cpp:22:
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp: In member function 'typename std::enable_if<jsoncons::is_stateless<A>::value, void>::type jsoncons::json_object<KeyT, Json, false>::set_(typename jsoncons::Json_object_<KeyT, Json>::key_storage_type&&, T&&) [with T = int&; A = std::allocator<char>; KeyT = std::__cxx11::basic_string<char>; Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >]':
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp:1055:118: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >' will change in GCC 7.1
                                    [](const value_type& a, const string_view_type& k){return a.key().compare(k) < 0;});
                                                                                                                      ^
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp: In member function 'typename std::enable_if<jsoncons::is_stateless<A>::value, void>::type jsoncons::json_object<KeyT, Json, false>::set_(typename jsoncons::Json_object_<KeyT, Json>::key_storage_type&&, T&&) [with T = int; A = std::allocator<char>; KeyT = std::__cxx11::basic_string<char>; Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >]':
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp:1055:118: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >' will change in GCC 7.1
                                    [](const value_type& a, const string_view_type& k){return a.key().compare(k) < 0;});
                                                                   

It is from the included 3rd party lib. Do we even want to fix that?

from kuksa.apps.

SebastianSchildt avatar SebastianSchildt commented on August 24, 2024

Ok, it seems more of a compiler fix. So I vote won't fix:
https://stackoverflow.com/questions/48149323/what-does-the-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7

We are not linking to dynamic libs (the json stuff is header-only lib), so there should be no problem.

Warning could be disabled

https://stackoverflow.com/questions/52020305/what-exactly-does-gccs-wpsabi-option-do-what-are-the-implications-of-supressi
(tested, works)

But that is only cosemtic, so I rather keep it, as there might be situations where it is more important

from kuksa.apps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.