vector warning

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

vector warning

跳至解决方案
5,281 次查看
edw8
Contributor III

For several MCUXpresso IDE versions now going back to 10.1.0, I see a bunch of notes in the build output regarding my code including the <vector> header file. This is a C++11 project using vectors. The notes are mostly annoying though suspicious. Seeing that subsequent build toolchain updates in MCUXpresso did not resolve or get rid of these notes, I wanted to ask the MCUXpresso design team about the plan to correct/remove them.

The sample below comes for just one .cpp file. I have a similar set for other .cpp files that include <vector>

Building file: ../src/switch_fabric/optce_conn_mgr_port.cpp
Invoking: MCU C++ Compiler
arm-none-eabi-c++ -DDEBUG -D__MCUXPRESSO -DCORE_M7 -DCR_PRINTF_CHAR -D__GENERIC_M7__ -D__NEWLIB__ -D__USE_CMSIS -DSDK_OS_FREE_RTOS -DFSL_RTOS_FREE_RTOS -I"../inc/public" -I"../src/switch_fabric" -I"../src/tasks" -I"../src/tasks/pool" -I"../../../components/lCON/inc/public" -I"../../../components/lSPI/inc/public" -I"../../../components/lTimingProfiler/src" -I"../../../components/lUTIL/inc/public" -I"../../../vendor/sdk/devices/RT1052/utilities" -I"../../../vendor/sdk/rtos/amazon-freertos/FreeRTOS/portable" -I"../../../vendor/sdk/rtos/amazon-freertos/include" -I"../../../vendor/sdk/rtos/amazon-freertos/portable" -I"../../../vendor/sdk/src" -O0 -g3 -Wall -c -fmessage-length=0 -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -D__NEWLIB__ -MMD -MP -MF"src/switch_fabric/optce_conn_mgr_port.d" -MT"src/switch_fabric/optce_conn_mgr_port.o" -MT"src/switch_fabric/optce_conn_mgr_port.d" -o "src/switch_fabric/optce_conn_mgr_port.o" "../src/switch_fabric/optce_conn_mgr_port.cpp"
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:69:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::reserve(std::vector<_Tp, _Alloc>::size_type) [with _Tp = optce::ConnMgrSpectrumUnitBase; _Alloc = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:73:12: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
pointer __tmp = _M_allocate_and_copy(__n,
^~~~~
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:64:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(std::vector<_Tp, _Alloc>::size_type, _ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::move_iterator<optce::ConnMgrSpectrumUnitBase*>; _Tp = optce::ConnMgrSpectrumUnitBase; _Alloc = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h:1257:2: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
_M_allocate_and_copy(size_type __n,
^~~~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h:1257:2: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h:1263:35: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
std::__uninitialized_copy_a(__first, __last, __result,
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
_M_get_Tp_allocator());
~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:69:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {optce::ConnMgrSpectrumUnitBase}; _Tp = optce::ConnMgrSpectrumUnitBase; _Alloc = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:105:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
_M_realloc_insert(end(), std::forward<_Args>(__args)...);
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {optce::ConnMgrPortBase}; _Tp = optce::ConnMgrPortBase; _Alloc = std::allocator<optce::ConnMgrPortBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:105:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<optce::ConnMgrPortBase*, std::vector<optce::ConnMgrPortBase> >' changed in GCC 7.1
_M_realloc_insert(end(), std::forward<_Args>(__args)...);
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:63:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In function '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator<optce::ConnMgrSpectrumUnitBase*>; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*; _Tp = optce::ConnMgrSpectrumUnitBase]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:287:5: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:287:5: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:289:63: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
{ return std::uninitialized_copy(__first, __last, __result); }
^
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:69:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {optce::ConnMgrSpectrumUnitBase}; _Tp = optce::ConnMgrSpectrumUnitBase; _Alloc = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<optce::ConnMgrSpectrumUnitBase>::iterator {aka __gnu_cxx::__normal_iterator<optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >}' changed in GCC 7.1
vector<_Tp, _Alloc>::
^~~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {optce::ConnMgrPortBase}; _Tp = optce::ConnMgrPortBase; _Alloc = std::allocator<optce::ConnMgrPortBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<optce::ConnMgrPortBase>::iterator {aka __gnu_cxx::__normal_iterator<optce::ConnMgrPortBase*, std::vector<optce::ConnMgrPortBase> >}' changed in GCC 7.1
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:63:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In function '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<optce::ConnMgrSpectrumUnitBase*>; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:115:5: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
uninitialized_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:115:5: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:134:41: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
__uninit_copy(__first, __last, __result);
^
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In function '_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = optce::ConnMgrSpectrumUnitBase*; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*; _Allocator = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:312:69: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc);
^
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In static member function 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<optce::ConnMgrSpectrumUnitBase*>; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*; bool _TrivialValueTypes = false]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
__uninit_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type 'std::move_iterator<optce::ConnMgrSpectrumUnitBase*>' changed in GCC 7.1
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:64:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h: In copy constructor 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = optce::ConnMgrSpectrumUnitBase; _Alloc = std::allocator<optce::ConnMgrSpectrumUnitBase>]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_vector.h:331:31: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
std::__uninitialized_copy_a(__x.begin(), __x.end(),
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
this->_M_impl._M_start,
~~~~~~~~~~~~~~~~~~~~~~~
_M_get_Tp_allocator());
~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\vector:63:0,
from ../src/switch_fabric/optce_conn_mgr_port.cpp:25:
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In function '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*; _Tp = optce::ConnMgrSpectrumUnitBase]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:287:5: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:287:5: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:289:63: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
{ return std::uninitialized_copy(__first, __last, __result); }
^
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In function '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:115:5: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
uninitialized_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:115:5: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:134:41: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
__uninit_copy(__first, __last, __result);
^
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h: In static member function 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >; _ForwardIterator = optce::ConnMgrSpectrumUnitBase*; bool _TrivialValueTypes = false]':
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
__uninit_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~
c:\nxp\mcuxpressoide_10.2.1_795\ide\tools\arm-none-eabi\include\c++\7.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<const optce::ConnMgrSpectrumUnitBase*, std::vector<optce::ConnMgrSpectrumUnitBase> >' changed in GCC 7.1
Finished building: ../src/switch_fabric/optce_conn_mgr_port.cpp

标记 (2)
0 项奖励
回复
1 解答
3,852 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

This warning relates to an ABI compatibility issue between code built with GCC6 and GCC7. As long as you are building all code with the same GCC version, you should be able to ignore, and disable using the "-Wno-psabi" option.

For more information, do an internet search for something like "parameter passing for argument changed in GCC 7.1" which will give numerous hits, for instance: https://gcc.gnu.org/ml/gcc/2017-05/msg00072.html 

Regards,

MCUXpresso IDE Support

在原帖中查看解决方案

0 项奖励
回复
1 回复
3,853 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

This warning relates to an ABI compatibility issue between code built with GCC6 and GCC7. As long as you are building all code with the same GCC version, you should be able to ignore, and disable using the "-Wno-psabi" option.

For more information, do an internet search for something like "parameter passing for argument changed in GCC 7.1" which will give numerous hits, for instance: https://gcc.gnu.org/ml/gcc/2017-05/msg00072.html 

Regards,

MCUXpresso IDE Support

0 项奖励
回复