We currently pass -Wno-unused-function explicitly to disable warnings about unused functions. This is problematic in the test suite. It’s too easy to add a test but forget to call it. So we should enable -Wunused-function at least in the test suite. This will also catch untested functions. Maybe this could be scoped to the body of tests.c etc. using pragmas (to exclude all the #include).
We have some unused functions in the (non-test) code base when compiling the library itself. There’s nothing wrong with this per se, but even for those, annotating them explicitly as unused in the code (which will be necessary to suppress the warning) sounds like a good idea. But this is more complex because we have multiple ways to compile our code. I guess warnings should be based on the use in the library with all modules enabled. That sounds like it will need some build system logic…
And we should leave the warning disabled when compiling other helper binaries, e.g., benchmark or the precomputation programs.