ci: Bump GCC_SNAPSHOT_MAJOR to 15 #1583

pull maflcko wants to merge 2 commits into bitcoin-core:master from maflcko:patch-1 changing 6 files +13 −13
  1. maflcko commented at 5:42 PM on August 12, 2024: contributor

    Follow-up to #1313

    Clang should silently follow the main devel branch, but GCC needs to be bumped manually.

  2. ci: Bump GCC_SNAPSHOT_MAJOR to 15 e34b476730
  3. real-or-random commented at 6:50 PM on August 12, 2024: contributor
  4. maflcko commented at 7:36 PM on August 12, 2024: contributor

    Yeah, I guess one solution would be to be verbose and write the array:

    static const unsigned char PREFIX[19] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', ' ', 't', 'e', 's', 't', ' ', 'i', 'n', 'i', 't'};
    

    an alternative would be to disable the warning, which seems cleaner and any issues that the warning theoretically could uncover should be detectable by a the existing CI sanitizer builds?

  5. real-or-random commented at 9:48 PM on August 12, 2024: contributor
    static const unsigned char PREFIX[19] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', ' ', 't', 'e', 's', 't', ' ', 'i', 'n', 'i', 't'};
    

    This is ultimately a question of taste, but I suggest this because I think it's the most readable:

    static const unsigned char PREFIX[] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', ' ', 't', 'e', 's', 't', ' ', 'i', 'n', 'i', 't'};
    

    This makes it unambiguously clear that we consider it an array and not a string (i.e., it's not null-terminated), the reader doesn't need to count the chars, and we can use sizeof(PREFIX).

    We define such constant arrays in multiple code locations, see https://github.com/bitcoin-core/secp256k1/actions/runs/10356727938/job/28667982412?pr=1583 Whenever I review such code, I need to count the chars manually to check whether the terminating null byte is included or not.

  6. refactor: Use array initialization for unterminated strings
    The previous code is correct and harmless to initialize an array with a
    non-terminated character sequence using a string literal.
    
    However, it requires exactly specifying the array size, which can be
    cumbersome.
    
    Also, GCC-15 may issue the -Wunterminated-string-initialization warning.
    [1]
    
    Fix both issues by using array initialization. This refactoring commit
    does not change behavior.
    
    [1] Example warning:
    
    src/modules/schnorrsig/main_impl.h:48:46: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
       48 | static const unsigned char bip340_algo[13] = "BIP0340/nonce";
          |                                              ^~~~~~~~~~~~~~~
    fa67b6752d
  7. maflcko force-pushed on Aug 15, 2024
  8. maflcko commented at 5:03 PM on August 15, 2024: contributor

    Whenever I review such code, I need to count the chars manually to check whether the terminating null byte is included or not.

    Good point about the review overhead and ambiguity. I pushed a commit with your suggestion.

  9. hebasto approved
  10. hebasto commented at 7:19 PM on August 15, 2024: member

    ACK fa67b6752d8ba3e4c41f6c36b1c6b94a21770419, I have reviewed the code and it looks OK.

    I can see gcc version 15.0.0 20240811 (experimental) (GCC) in the CI logs.

  11. real-or-random approved
  12. real-or-random commented at 2:04 PM on August 17, 2024: contributor

    utACK fa67b6752d8ba3e4c41f6c36b1c6b94a21770419

  13. real-or-random added the label ci on Aug 17, 2024
  14. real-or-random added the label refactor/smell on Aug 17, 2024
  15. real-or-random added the label assurance on Aug 17, 2024
  16. real-or-random merged this on Aug 17, 2024
  17. real-or-random closed this on Aug 17, 2024

  18. maflcko deleted the branch on Aug 19, 2024
  19. hebasto referenced this in commit 611562806c on Sep 7, 2024
  20. fanquake referenced this in commit df86a4f333 on Sep 9, 2024
  21. vmta referenced this in commit d5f931329c on Sep 25, 2024
  22. vmta referenced this in commit 4d1f6d5635 on Oct 29, 2024
  23. vmta referenced this in commit f40affbf6c on Nov 21, 2024
  24. vmta referenced this in commit cc8d145633 on Nov 22, 2024
  25. janus referenced this in commit c1f7fc953e on Jan 12, 2025
  26. janus referenced this in commit b5fe403b11 on Jan 12, 2025
  27. div72 referenced this in commit af627d47c3 on Apr 12, 2025
  28. fanquake referenced this in commit 5c8a55f917 on May 13, 2025
  29. fanquake referenced this in commit 7fc15db5f9 on May 16, 2025
  30. fanquake referenced this in commit 706fdf1a78 on May 30, 2025
  31. fanquake referenced this in commit e26bac0c70 on Jun 17, 2025
  32. Fabcien referenced this in commit 7e10d20cb3 on Jan 31, 2026
  33. Fabcien referenced this in commit 2b629de6d9 on Jan 31, 2026
  34. real-or-random referenced this in commit 211323d6b7 on Feb 13, 2026
  35. github-actions[bot] referenced this in commit 758d4e90b4 on Mar 1, 2026
  36. github-actions[bot] referenced this in commit 68a2178f22 on Mar 1, 2026
  37. github-actions[bot] referenced this in commit a8bc1a0b2b on Mar 1, 2026
  38. 0x000000000019d6689c085ae165831e934ff76 referenced this in commit 3b9450150d on Mar 2, 2026
  39. csjones referenced this in commit a4d92824ae 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-05-19 06:52 UTC