Remove trailing spaces and introduce -Wtrailing-whitespace=any compiler flag #1813

pull hebasto wants to merge 3 commits into bitcoin-core:master from hebasto:260128-trailing-space changing 6 files +12 −3
  1. hebasto commented at 11:26 am on January 28, 2026: member

    This PR removes trailing whitespace and introduces the -Wtrailing-whitespace=any compiler flag. This enforces the rule from CONTRIBUTING.md (“Avoid trailing whitespace”) directly in the CI.

    This fix is required to unbreak Bitcoin Core CI builds using GCC 15 after merging https://github.com/bitcoin/bitcoin/pull/34412.

  2. hebasto force-pushed on Jan 28, 2026
  3. hebasto force-pushed on Jan 28, 2026
  4. in src/checkmem.h:89 in 65f0e7f80c
    84 #  endif
    85 #    include <valgrind/memcheck.h>
    86 #  if defined(__clang__) && defined(__APPLE__)
    87 #    pragma clang diagnostic pop
    88+#  elif defined(__GNUC__) && (__GNUC__ >= 15)
    89+#      pragma GCC diagnostic pop
    


    real-or-random commented at 12:31 pm on January 29, 2026:
    nit: indentation
  5. real-or-random commented at 12:35 pm on January 29, 2026: contributor

    Concept ACK

    I was a bit surprised to see that GCC has this option given that it’s not primarily a linter, but okay, happy to take them if they’re for free.

    I think if we enable this, we could as well enable -Wleading-whitespace=spaces?

  6. real-or-random added the label tweak/refactor on Jan 29, 2026
  7. real-or-random added the label meta/development on Jan 29, 2026
  8. hebasto force-pushed on Jan 29, 2026
  9. hebasto commented at 12:45 pm on January 29, 2026: member

    @real-or-random

    Thank you for the review! Your feedback has been addressed.

    I think if we enable this, we could as well enable -Wleading-whitespace=spaces?

    Done.

  10. real-or-random approved
  11. real-or-random commented at 12:52 pm on January 29, 2026: contributor

    utACK https://github.com/bitcoin-core/secp256k1/pull/1813/changes/d9c32350a054bc9bdaf7757e55ac982b9a3602a4

    The CI failures on QEMU jobs are certainly unrelated, but let’s maybe wait for the non-QEMU jobs.

  12. hebasto commented at 1:37 pm on January 29, 2026: member

    utACK d9c3235

    The CI failures on QEMU jobs are certainly unrelated, but let’s maybe wait for the non-QEMU jobs.

    Hmm… The failed runs are reusing old Docker images, so there shouldn’t be any changes in that environment.

  13. real-or-random commented at 1:43 pm on January 29, 2026: contributor
    I agree that this is very dubious. I’ve just triggered a rerun of all jobs. Let’s see if this solves it. And if not, we can still check if the same jobs fail as in the first run. Clearing the cache may also be some other shot in the dark, but let’s wait for now.
  14. hebasto commented at 1:59 pm on January 29, 2026: member

    … we can still check if the same jobs fail as in the first run.

    They differ…

  15. hebasto commented at 2:05 pm on January 29, 2026: member
    actions/cache has been updated a few hour ago. Maybe it’s the culprit we are looking for.
  16. real-or-random commented at 2:22 pm on January 29, 2026: contributor

    actions/cache has been updated a few hour ago. Maybe it’s the culprit we are looking for.

    This could very well be the reason. Let’s just wait for a day to let this settle a bit. (I’m, in principle, happy to merge this PR as-is, but then CI may end up being red on master, which I would like to avoid.)

  17. hebasto commented at 3:22 pm on January 29, 2026: member

    actions/cache has been updated a few hour ago. Maybe it’s the culprit we are looking for.

    This could very well be the reason. Let’s just wait for a day to let this settle a bit. (I’m, in principle, happy to merge this PR as-is, but then CI may end up being red on master, which I would like to avoid.)

    FWIW, I’ve triggered a cache invalidation in https://github.com/hebasto/secp256k1/commit/94ec4e24bca4960060f80b77cacdd73116bf365d, and the resulting CI run is 100% green.

  18. hebasto commented at 12:54 pm on February 2, 2026: member

    actions/cache has been updated a few hour ago. Maybe it’s the culprit we are looking for.

    This could very well be the reason. Let’s just wait for a day to let this settle a bit. (I’m, in principle, happy to merge this PR as-is, but then CI may end up being red on master, which I would like to avoid.)

    Do you want me to rebase this PR to get a clean CI run?

  19. real-or-random commented at 1:00 pm on February 2, 2026: contributor

    Do you want me to rebase this PR to get a clean CI run?

    Sounds good

  20. refactor: Remove trailing whitespace 13e3bee504
  21. build: Add `-Wtrailing-whitespace=any` compiler flag fb229e7602
  22. build: Add `-Wleading-whitespace=spaces` compiler flag 86cae58d2f
  23. hebasto force-pushed on Feb 2, 2026
  24. hebasto commented at 1:09 pm on February 2, 2026: member

    Do you want me to rebase this PR to get a clean CI run?

    Sounds good

    Rebased.

  25. real-or-random approved
  26. real-or-random commented at 1:17 pm on February 2, 2026: contributor
    utACK 86cae58d2f342f8a3b49dd70dca8989cb271c504
  27. fanquake commented at 2:48 pm on February 2, 2026: member
    LGTM
  28. real-or-random merged this on Feb 2, 2026
  29. real-or-random closed this on Feb 2, 2026

  30. fanquake referenced this in commit 9d4c9b0035 on Feb 2, 2026
  31. hebasto deleted the branch on Feb 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-02-16 20:15 UTC

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