[WIP] utils: introduce a runtime error in case of overflow in GetArgInt #24016

pull vincenzopalazzo wants to merge 2 commits into bitcoin:master from vincenzopalazzo:vincenzopalazzo/cmd_atoi changing 11 files +103 −13
  1. vincenzopalazzo commented at 3:04 pm on January 9, 2022: none

    This PR is built on top of #23841 and I would like to have some suggestions for my first contribution to the cpp source code.

    In particular, how to return the InitError and there is some particular global variable to manage the deprecation process?

    as TODO I would like to introduce additional unite tests to cover this new state

    Fixes https://github.com/bitcoin/bitcoin/issues/23843

  2. Restore atoi64 compatibility with old versions of Bitcoin Core
    The new locale-independent atoi64 method introduced in #20452 behaves
    differently for values passed which are greater than the uint64_t max.
    This commit is proof of that, meant to spur discussion on how to handle
    such an incompatibility.
    
    Introduce LocaleIndependentAtoi64 which behaves the same way that
    previous versions of Bitcoin Core has when faced with under- and
    overflow.
    
    This behavior was implicitly changed in #20452, but has not yet
    been included in a release.
    
    Attempts to use LocaleIndependentAtoi for int64_t return values
    will result in a compilation error.
    ac1a5b113c
  3. utils: introduce a runtime error in case of overflow in GetArgInt
    Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
    7f6a97a1a4
  4. DrahtBot added the label Mining on Jan 9, 2022
  5. DrahtBot added the label RPC/REST/ZMQ on Jan 9, 2022
  6. DrahtBot added the label Utils/log/libs on Jan 9, 2022
  7. DrahtBot added the label Wallet on Jan 9, 2022
  8. DrahtBot commented at 8:21 pm on January 9, 2022: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #24041 (util: Restore GetIntArg saturating behavior by ryanofsky)
    • #17783 (util: Fix -norpcwhitelist, -norpcallowip, and similar corner case behavior by ryanofsky)
    • #17581 (refactor: Remove settings merge reverse precedence code by ryanofsky)
    • #17580 (refactor: Add ALLOW_LIST flags and enforce usage in CheckArgFlags by ryanofsky)
    • #17493 (util: Forbid ambiguous multiple assignments in config file by ryanofsky)
    • #16545 (refactor: Implement missing error checking for ArgsManager flags by ryanofsky)

    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.

  9. vincenzopalazzo closed this on Jan 12, 2022

  10. DrahtBot locked this on Jan 12, 2023

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

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