Suppress `-Wunused-parameter` when building for coverage analysis #1244

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:230314-unused changing 2 files +10 −7
  1. hebasto commented at 8:08 PM on March 14, 2023: member

    On master (427bc3cdcfbc74778070494daab1ae5108c71368), when configured with --enable-coverage, gcc emits multiple warnings:

    $ make
    ...
    src/ecmult_impl.h: In function ‘secp256k1_ecmult_table_get_ge’:
    src/ecmult_impl.h:122:113: warning: unused parameter ‘w’ [-Wunused-parameter]
      122 | SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
          |                                                                                                             ~~~~^
    src/ecmult_impl.h: In function ‘secp256k1_ecmult_table_get_ge_lambda’:
    src/ecmult_impl.h:132:143: warning: unused parameter ‘w’ [-Wunused-parameter]
      132 | SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_lambda(secp256k1_ge *r, const secp256k1_ge *pre, const secp256k1_fe *x, int n, int w) {
          |                                                                                                                                           ~~~~^
    src/ecmult_impl.h: In function ‘secp256k1_ecmult_table_get_ge_storage’:
    src/ecmult_impl.h:142:129: warning: unused parameter ‘w’ [-Wunused-parameter]
      142 | SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
          |                                                                                                                             ~~~~^
    ...
    

    This PR fixes them.

  2. Suppress `-Wunused-parameter` when building for coverage analysis 4429a8c218
  3. jonasnick commented at 7:46 PM on March 20, 2023: contributor

    Can confirm that this fixes automake.

  4. real-or-random commented at 1:48 PM on March 21, 2023: contributor

    Concept ACK

    What about replacing the macro by a function, similar to https://github.com/bitcoin-core/secp256k1/blob/master/src/field_5x52_impl.h#L37? Macros are ... fragile.

  5. Replace `SECP256K1_ECMULT_TABLE_VERIFY` macro by a function 5bb03c2911
  6. hebasto commented at 3:31 PM on March 21, 2023: member

    What about replacing the macro by a function, similar to https://github.com/bitcoin-core/secp256k1/blob/master/src/field_5x52_impl.h#L37? Macros are ... fragile.

    Done.

  7. real-or-random approved
  8. real-or-random commented at 2:21 AM on March 25, 2023: contributor

    utACK 5bb03c29116409ace8855e64bf2e2b2d45871469

  9. jonasnick commented at 7:17 AM on March 28, 2023: contributor

    ACK 5bb03c29116409ace8855e64bf2e2b2d45871469

  10. jonasnick merged this on Mar 28, 2023
  11. jonasnick closed this on Mar 28, 2023

  12. hebasto deleted the branch on Mar 28, 2023
  13. sipa referenced this in commit e1552d578e on Apr 11, 2023
  14. sipa referenced this in commit c981671e9b on Apr 14, 2023
  15. hebasto referenced this in commit 49c52ea2b1 on May 13, 2023
  16. RandyMcMillan referenced this in commit 3cc75121b3 on May 27, 2023
  17. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  18. vmta referenced this in commit 8f03457eed on Jul 1, 2023
  19. alokeutpal approved

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-04-14 11:15 UTC

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