build: Add -Wreserved-identifier supported by clang #1206

pull real-or-random wants to merge 1 commits into bitcoin-core:master from real-or-random:202302-wreserved-identifier changing 1 files +1 −0
  1. real-or-random commented at 2:17 PM on February 2, 2023: contributor

    This warns on certain identifiers reserved by the C standard, namely

    • identifiers that begin with an underscore followed by an uppercase letter, and
    • identifiers in the global namespace that begin with an underscore.

    We had used such identifiers in the past for macros in include guards, and we should make sure that we don't reintroduce such identifiers going forward.

    Note that C reserves more identifiers for "future library directions", e.g., identifiers that begin with "str" followed by a lowercase letter. But even the C standards committee has decided that this is somewhat silly and adopted a proposal [1] for C23 that removes the restriction that programs using these identifiers have UB. Instead, these identifiers are now "potentially reserved", which is not a normative restriction but simply an informative warning that the identifiers may become fully reserved in the future.

    [1] https://www.open-std.org/jtc1/sc22/WG14/www/docs/n2625.pdf

  2. build: Add -Wreserved-identifier supported by clang
    This warns on certain identifiers reserved by the C standard, namely
     * identifiers that begin with an underscore followed by an uppercase
       letter, and
     * identifiers in the global namespace that begin with an underscore.
    
    We had used such identifiers in the past for macros in include guards,
    and we should make sure that we don't reintroduce such identifiers
    going forward.
    
    Note that C reserves more identifiers for "future library directions",
    e.g., identifiers that begin with "str" followed by a lowercase letter.
    But even the C standards committee has decided that this is somewhat
    silly and adopted a proposal [1] for C23 that removes the restriction
    that programs using these identifiers have UB. Instead, these
    identifiers are now "potentially reserved", which is not a normative
    restriction but simply an informative warning that the identifiers
    may become fully reserved in the future.
    
    [1] https://www.open-std.org/jtc1/sc22/WG14/www/docs/n2625.pdf
    8c7e0fc1de
  3. jonasnick commented at 4:00 PM on February 2, 2023: contributor

    tested ACK 8c7e0fc1de048be98a1f1bc75557671afc14beaa

  4. sipa commented at 9:14 PM on February 2, 2023: contributor

    utACK 8c7e0fc1de048be98a1f1bc75557671afc14beaa

  5. real-or-random merged this on Feb 3, 2023
  6. real-or-random closed this on Feb 3, 2023

  7. hebasto referenced this in commit 7c0cc5d976 on Mar 7, 2023
  8. dhruv referenced this in commit a5df79db12 on Mar 7, 2023
  9. dhruv referenced this in commit 77b510d84c on Mar 7, 2023
  10. sipa referenced this in commit 763079a3f1 on Mar 8, 2023
  11. div72 referenced this in commit 945b094575 on Mar 14, 2023
  12. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  13. vmta referenced this in commit 8f03457eed on Jul 1, 2023
  14. delta1 referenced this in commit 3f32c20932 on Aug 8, 2023
  15. real-or-random referenced this in commit 5d8fa825e2 on Aug 16, 2023
  16. delta1 referenced this in commit 31ac0c1081 on Aug 31, 2023
  17. janus referenced this in commit 4816e2a921 on Sep 3, 2023
  18. backpacker69 referenced this in commit 26f6d832fb on Mar 5, 2024
  19. str4d referenced this in commit b350ac56ac on Jun 4, 2025
  20. Fabcien referenced this in commit 3ad6f5f454 on Apr 11, 2026
  21. Fabcien referenced this in commit 0f36f09980 on Apr 11, 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