void opcontrol() {
using Tuple = std::tuple<uint32_t, double, double, double, double, double>;
std::vector<Tuple> data;
data.push_back(std::make_tuple(1, 1.11, 2.33, 44.44, 55.55, 6.66));
pros::delay(20);
}
This is a very common piece of code. There should be no warning.
Add in makefile “WARNFLAGS+=-Wno-psabi” too dangerous.
but use " pragma GCC diagnostic ignored “-Wno-psabi”
The compiler also shows that it is unrecognizable “-Wno-psabi”
pragma GCC diagnostic ignored “???”
What options should I use to ignore this warning?
To solve this problem, I even updated the compiler to 8.2.1.
There seems to be no correct answer to stack overflow.
PS D:\test> make all
Cleaning project
Compiling src/autonomous.cpp [OK]
Compiling src/initialize.cpp [OK]
Compiling src/opcontrol.cpp [WARNINGS]
In file included from c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\vector:63,
from src/opcontrol.cpp:3:
c:\program files\pros\usr\arm-none-eabi\include\c++\8.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<std::tuple<long unsigned int, double, double, double, double, double>*>; _ForwardIterator = std::tuple<long unsigned int, double, double, double, double, double>*; bool _TrivialValueTypes = false]':
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type 'std::move_iterator<std::tuple<long unsigned int, double, double, double, double, double>*>' changed in GCC 7.1
__uninit_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\stl_uninitialized.h:76:9: note: parameter passing for argument of type 'std::move_iterator<std::tuple<long unsigned int, double, double, double, double, double>*>' changed in GCC 7.1
In file included from c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\vector:69,
from src/opcontrol.cpp:3:
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {std::tuple<long unsigned int, double, double, double, double, double>}; _Tp = std::tuple<long unsigned int, double, double, double, double, double>; _Alloc = std::allocator<std::tuple<long unsigned int, double, double, double, double, double> >]':
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\vector.tcc:413:7: note: parameter passing for argument of type 'std::vector<std::tuple<long unsigned int, double, double, double, double, double> >::iterator' {aka '__gnu_cxx::__normal_iterator<std::tuple<long unsigned int, double, double, double, double, double>*, std::vector<std::tuple<long unsigned int, double, double, double, double, double> > >'} changed in GCC 7.1
vector<_Tp, _Alloc>::
^~~~~~~~~~~~~~~~~~~
In file included from c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\vector:63,
from src/opcontrol.cpp:3:
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\stl_uninitialized.h:134:15: note: parameter passing for argument of type 'std::move_iterator<std::tuple<long unsigned int, double, double, double, double, double>*>' changed in GCC 7.1
return std::__uninitialized_copy<__is_trivial(_ValueType1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __is_trivial(_ValueType2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __assignable>::
~~~~~~~~~~~~~~~~~~
__uninit_copy(__first, __last, __result);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\stl_uninitialized.h:134:15: note: parameter passing for argument of type 'std::move_iterator<std::tuple<long unsigned int, double, double, double, double, double>*>' changed in GCC 7.1
return std::__uninitialized_copy<__is_trivial(_ValueType1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __is_trivial(_ValueType2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __assignable>::
~~~~~~~~~~~~~~~~~~
__uninit_copy(__first, __last, __result);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\vector:69,
from src/opcontrol.cpp:3:
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\vector.tcc: In function 'void opcontrol()':
c:\program files\pros\usr\arm-none-eabi\include\c++\8.2.1\bits\vector.tcc:109:4: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<std::tuple<long unsigned int, double, double, double, double, double>*, std::vector<std::tuple<long unsigned int, double, double, double, double, double> > >' changed in GCC 7.1
_M_realloc_insert(end(), std::forward<_Args>(__args)...);
^~~~~~~~~~~~~~~~~
Adding timestamp [OK]
Linking project with okapilib,libpros [OK]
Section sizes:
text data bss total hex filename
421.44KB 3.14KB 2.59MB 3.01MB 300075 bin/output.elf
Creating bin/output.bin for VEX EDR V5 [DONE]
PS D:\test>