Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the gcc warning "project parameter passing for X changed in GCC 7.1" mean?

Tags:

c++

gcc

I have a C++ project that builds fine and without warnings with gcc 7.2 on x86 Linux and Windows, I needed to port it to an ARM device so I tried to crosscompile it with an "arm-linux-gnueabihf" gcc 7.2 that runs on my x86 machine, it builds but I get a lot of warnings of this kind

note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<P2d*, std::vector<P2d> >' changed in GCC 7.1
_M_realloc_insert(end(), __x);

and

/opt/armv7-gcc-2017/arm-linux-gnueabihf/include/c++/7.2.0/bits/vector.tcc:105:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<cpzparser::Anchor*, std::vector<cpzparser::Anchor> >' changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);

or

/opt/armv7-gcc-2017/arm-linux-gnueabihf/include/c++/7.2.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<cpzparser::PointEntity>::iterator {aka __gnu_cxx::__normal_iterator<cpzparser::PointEntity*, std::vector<cpzparser::PointEntity> >}' changed in GCC 7.1
       vector<_Tp, _Alloc>::

the generated executable seems to work fine but I am worried by the presence of all those warnings since I have no idea of what they mean.. any clue?

like image 208
woggioni Avatar asked Jan 08 '18 11:01

woggioni


1 Answers

That warning is telling you that there was a subtle ABI change (actually a conformance fix) between 6 and 7.1, such that libraries built with 6.x or earlier may not work properly when called from code built with 7.x (and vice-versa). As long as all your C++ code is built with GCC 7.1 or later, you can safely ignore this warning. To disable it, pass -Wno-psabi to the compiler.

For more details on the context of the change, see the GCC 7 changelog, and the associated bug.

like image 166
Sneftel Avatar answered Nov 19 '22 04:11

Sneftel