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 cross-referenced this on Feb 7, 2023 from issue build: Add CMake-based build system by hebasto
  8. hebasto referenced this in commit 7c0cc5d976 on Mar 7, 2023
  9. dhruv referenced this in commit a5df79db12 on Mar 7, 2023
  10. dhruv referenced this in commit 77b510d84c on Mar 7, 2023
  11. sipa referenced this in commit 763079a3f1 on Mar 8, 2023
  12. div72 referenced this in commit 945b094575 on Mar 14, 2023
  13. hebasto cross-referenced this on Apr 11, 2023 from issue test: Silent noisy clang warnings about Valgrind code on macOS x86_64 by hebasto
  14. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  15. vmta referenced this in commit 8f03457eed on Jul 1, 2023

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: 2024-11-21 20:15 UTC

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