GCC has an annoying habit of throwing warnings about ABI changes, e.g. this simple code:
will produce these warnings:
Trying to use
Since most Teensy programs are completely self-contained (i.e. they don't link to any precompiled libraries), can we just turn off the ABI change warnings by adding "-Wno-psabi" to the command line (adding it after -Wall to $platform.build.flags.common in boards.txt)? The warnings aren't relevant when the entirety of the program is being compiled by a single compiler, and GCC yelling about "problems" with completely valid syntax is just obnoxious.
Code:
#include <vector>
std::vector<uint64_t> foo;
void setup() {
foo.push_back(42);
}
void loop() {}
Code:
In file included from \appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\vector:72,
from \appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\functional:62,
from \AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/inplace_function.h:36,
from \AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:51,
from \AppData\Local\Temp\arduino\sketches\5EE072DD4E28BAF7D30E38CB3D918452\pch\Arduino.h:6:
\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {long long unsigned int}; _Tp = long long unsigned int; _Alloc = std::allocator<long long unsigned int>]':
\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\vector.tcc:426:7: note: parameter passing for argument of type 'std::vector<long long unsigned int>::iterator' changed in GCC 7.1
426 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\vector.tcc: In function 'void setup()':
\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\vector.tcc:121:28: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<long long unsigned int*, std::vector<long long unsigned int> >' changed in GCC 7.1
121 | _M_realloc_insert(end(), std::forward<_Args>(__args)...);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Trying to use
does not shut it up. This is typical, GCC has had long-running issues with pragmas not working properly in C++ code.#pragma GCC diagnostic ignored "-Wpsabi"
Since most Teensy programs are completely self-contained (i.e. they don't link to any precompiled libraries), can we just turn off the ABI change warnings by adding "-Wno-psabi" to the command line (adding it after -Wall to $platform.build.flags.common in boards.txt)? The warnings aren't relevant when the entirety of the program is being compiled by a single compiler, and GCC yelling about "problems" with completely valid syntax is just obnoxious.