我有一个C++项目,可以在x86 Linux和Windows上使用gcc 7.2进行构建,并且没有警告,我需要将它移植到ARM设备上,所以我尝试使用运行在我的"arm-linux-gnueabihf"gcc 7.2交叉编译它x86机器,它构建但我得到了很多这种警告
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);
Run Code Online (Sandbox Code Playgroud)
和
/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)...);
Run Code Online (Sandbox Code Playgroud)
要么
/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>::
Run Code Online (Sandbox Code Playgroud)
生成的可执行文件似乎工作正常,但我担心所有这些警告的存在,因为我不知道他们的意思..任何线索?
Sne*_*tel 22
该警告告诉您在6和7.1之间存在一个微妙的ABI更改(实际上是一致性修复),因此当使用7.x构建的代码调用时,使用6.x或更早版本构建的库可能无法正常工作(并且反之亦然).只要您的所有C++代码都是使用GCC 7.1或更高版本构建的,您就可以安全地忽略此警告.要禁用它,请传递-Wno-psabi
给编译器.
有关更改上下文的更多详细信息,请参阅GCC 7更改日志以及相关的错误.