Random thoughts

Newer compiler versions add different warnings to -Wall and this leads to unexpected warnings during compilation:

...
DiagonalMatrix.H:82:38: attention: template-id n'est pas permis pour un constructeur en C++20 [-Wtemplate-id-cdtor]
   82 |         explicit DiagonalMatrix<Type>(const label n);
...

To avoid this behaviour we can add warning-suppression flags to the Make/options file in the includes section. This can create nuances if we compile the project with older compilers, they issue warnings about unknown flags.

So, FOAM_EXTRA_CXXFLAGS can help us. For example, on openSUSE LEAP 16 with gcc 15.1.1 this line in ~/.OpenFOAM/prefs.sh:

export FOAM_EXTRA_CXXFLAGS="-Wno-template-id-cdtor -Wno-dangling-reference -Wno-overloaded-virtual"

removes irrelevant warnings.