Enable -Wunused-function #1831

issue real-or-random openend this issue on March 2, 2026
  1. real-or-random commented at 9:20 am on March 2, 2026: contributor

    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.

  2. real-or-random added the label assurance on Mar 2, 2026
  3. real-or-random added the label build on Mar 2, 2026
  4. real-or-random added the label tweak/refactor on Mar 2, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-09 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me