Skip to content

Enable -Wunused-function #1831

@real-or-random

Description

@real-or-random

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions