refactor: Fix implicit integer sign changes in strencodings #23756

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2111-int changing 3 files +8 −12
  1. MarcoFalke commented at 9:37 AM on December 13, 2021: member

    This removes casts where they are nonsensical (ToUpper/ToLower) and adds them where needed. Then, remove the suppressions.

    Also, reduce static memory usage.

  2. Fix implicit integer sign changes in strencodings fad6761cf7
  3. Reduce size of strencodings decode tables fa5865a9e3
  4. MarcoFalke added the label Refactoring on Dec 13, 2021
  5. MarcoFalke commented at 10:02 AM on December 13, 2021: member
    • I checked that the first commit on my machine with gcc and clang produces the same binary with -O2.
    • I checked that the second commit doesn't affect the binary size with clang, but reduces the size with gcc by 4096 Byte. I have not looked at the run-time memory change.
  6. MarcoFalke renamed this:
    Fix implicit integer sign changes in strencodings
    refactor: Fix implicit integer sign changes in strencodings
    on Dec 13, 2021
  7. DrahtBot commented at 6:42 PM on December 13, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. shaavan approved
  9. shaavan commented at 11:45 AM on December 14, 2021: contributor

    crACK fa5865a9e339e7fe4068fbcce2ac055ed49eddfd

    • The first commit prevents implicit sign change by manually casting the variables. This commit also removes unnecessary casting for ToUpper and ToLower functions.
    • Since after the changes done in the first commit, we do not “expect” implicit-integer-sign-change warning, so it is removed from the sanitizer_suppresion/ubsan file.
    • The second commit changes type of decode_table[256] from int to int8_t since all the elements of this array are in the range [-128, 127], so no need for a higher memory consuming data type (int)
  10. MarcoFalke merged this on Dec 15, 2021
  11. MarcoFalke closed this on Dec 15, 2021

  12. MarcoFalke deleted the branch on Dec 15, 2021
  13. sidhujag referenced this in commit 69820454c4 on Dec 15, 2021
  14. Fabcien referenced this in commit 9df212fb74 on Dec 9, 2022
  15. DrahtBot locked this on Dec 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

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