Lots of warnings like "parameter passing for argument of type ... changed in GCC 7.1" when compiling with GCC 8

When cross compiling JUCE library code with a GCC 8 for ARM I get a lot of warnings like that:
note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<juce::NetworkServiceDiscovery::Service*, std::vector<juce::NetworkServiceDiscovery::Service> >’ changed in GCC 7.1 std::sort (services.begin(), services.end(), compareServices);

A stackoverflow post says that this can lead to problems if libraries compiled with older GCC versions are called but can be safely ignored if all code is built with a GCC version >= 7.1 and those warnings can be suspressed with -Wno-psabi. So I assume that this won’t be any problem, but I’m not really sure if I should expect any issues here. For your information, this targets a embedded linux which is based on a buildroot system that was compiled with the same GCC 8 toolchain I use to compile my JUCE code, however it runs a quite old Linux kernel that was definetively built with an older GCC. Any issues to expect from this combination?

Edit: I read the following in the GCC changelog:

On ARM targets (arm*--), a bug introduced in GCC 5 that affects conformance to the procedure call standard (AAPCS) has been fixed. The bug affects some C++ code where class objects are passed by value to functions and could result in incorrect or inconsistent code being generated. This is an ABI change.

This makes me come to the conclusion that this ABI change should in no way generate problems when operating with the old (pure C based) Linux kernel, furthermore I don’t see where the juce code accesses other precompiled C++ libraries where this change could cause a problem. Please correct me if I’m wrong. Would the JUCE team consider to wrap the code segments (mainly from juce_events and juce_data structures) in a #pragma GCC diagnostic ignored "-Wpsabi" block to suppress these warnings?


Any comment from the JUCE team to this warning? It’s also ok for me to just silence this warning with a compiler flag, however I want to be sure that this is a warning that can be safely ignored…

Any update on this? I’m running into this as well.

All I can say is that I never experienced any problem related to this warning and went with suppressing the warnings, however the last time I compiled that project was somewhen in November 2019, so my memories on this topic are not that fresh anymore :wink:

However I really wonder why not more people run into this, I guess cross compiling JUCE with a recent GCC for an embedded Linux target is not such an unusual use-case? Not sure about that, but don’t e.g. the Roli Blocks run something JUCE-based on an ARM :thinking:

1 Like

FYI, I’m not cross compiling. I install Juce on a Raspberry Pi and build right on that platform. Works fine, albeit slow, on Raspian Stretch (GCC 6.3.0) but I ran into this when I moved to Buster (GCC 8.3.0). Also now have to explicitly add -latomic linker flag to prevent link errors.

BTW, how did you end up suppressing the warnings?