It's pure curiosity more than problem.
I am compiling the same C++ code on a pc with Debian Stretch and on a raspberryPi with Raspbian Stretch. Both come with default gcc version 6.3.0 20170516 .
Well, the issue is that I get different messages in the compilation, which although they do not affect the final result because it compiles everything without errors, but so many notes only in raspbian call my attention a lot.
Any clue about it? I paste a chunk of the output messages, because on top of that it's enough.
Output on the raspberry:
In file included from /home/pi/lab/cnenos/src/Configuracion.hpp:7:0,
from /home/pi/lab/cnenos/src/Gateway.hpp:4,
from /home/pi/lab/cnenos/src/Gateway.cpp:1:
/home/pi/.hunter/_Base/60e121f/2620915/15e92a9/Install/include/nlohmann/json.hpp: In member function ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType,
NumberFloatType, AllocatorType, JSONSerializer>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSer
ializer>::operator[](nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::size_type) [with ObjectType = s
td::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long long int; NumberUnsignedType = long long unsigned int; NumberFloatType = double; Al
locatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’:
/home/pi/.hunter/_Base/60e121f/2620915/15e92a9/Install/include/nlohmann/json.hpp:15378:17: note: parameter passing for argument of type ‘std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<
> > >::const_iterator {aka __gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >}’ will change in GCC 7.1
m_value.array->insert(m_value.array->end(),
^~~~~~~
In file included from /usr/include/c++/6/map:61:0,
from /home/pi/.hunter/_Base/60e121f/2620915/15e92a9/Install/include/nlohmann/json.hpp:54,
from /home/pi/lab/cnenos/src/Configuracion.hpp:7,
from /home/pi/lab/cnenos/src/Gateway.hpp:4,
from /home/pi/lab/cnenos/src/Gateway.cpp:1:
/usr/include/c++/6/bits/stl_map.h: In member function ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [
with _Key = std::__cxx11::basic_string<char>; _Tp = nlohmann::basic_json<>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, nl
ohmann::basic_json<> > >]’:
/usr/include/c++/6/bits/stl_map.h:502:4: 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>, nl
ohmann::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
__i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
^~~
In file included from /usr/include/c++/6/vector:64:0,
from /home/pi/.hunter/_Base/60e121f/2620915/15e92a9/Install/include/nlohmann/json.hpp:57,
from /home/pi/lab/cnenos/src/Configuracion.hpp:7,
from /home/pi/lab/cnenos/src/Gateway.hpp:4,
from /home/pi/lab/cnenos/src/Gateway.cpp:1:
/usr/include/c++/6/bits/stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::size_type, cons
t value_type&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >]’:
/usr/include/c++/6/bits/stl_vector.h:1052:7: note: parameter passing for argument of type ‘std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::const_iterator {aka __gnu_cxx::__normal
_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >}’ will change in GCC 7.1
insert(const_iterator __position, size_type __n, const value_type& __x)
Repeated several for each file :-(
The C++ standard does not specify how the standard library should be implemented. It simply says what functionality it should provide.
This allows you to benefit from the most optimal implementation for different types of hardware.
In your case, a PC typically mounts an Intel or AMD processor, which are based on a CISC architecture , while a raspberry uses ARM, whose architecture is RISC .
This has its implications when performing the different operations. Thus, it is highly probable that the implementation of the standard library is different and that this generates different warning or error messages in the same situation.