GCC won't shut up about irrelevant ABI changes (needs "-Wno-psabi" ?)

jmarsh

Well-known member
GCC has an annoying habit of throwing warnings about ABI changes, e.g. this simple code:
Code:
#include <vector>

std::vector<uint64_t> foo;

void setup() {
  foo.push_back(42);
}

void loop() {}
will produce these warnings:
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
#pragma GCC diagnostic ignored "-Wpsabi"
does not shut it up. This is typical, GCC has had long-running issues with pragmas not working properly in C++ code.

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.
 
Yes, please. It's entirely obnoxious and I hate it. GCC should learn to shut up. I don't care that something or other changed in GCC 7.1 when we are *SEVERAL* versions ahead of that. Don't care at all. I really do wish the Teensy default compile options would turn that off. I've complained about it before. But, you notice it still does that. Please, someone shut it up.
 
Back
Top