HomePhabricator

[LINTER] Fix a couple cppcheck issues

Description

[LINTER] Fix a couple cppcheck issues

Summary:
This diff adds 2 cppcheck exceptions:

  • One for a bug with the current debian version (1.86):
   Error  (CPPCHECK) containerOutOfBounds
    Out of bounds access in expression 'test.at(1)' because 'test' is
empty
    and 'at' may be non-zero.

              48 bool sanity_test_range_fmt() {
              49     std::string test;
              50     try {
    >>>       51         test.at(1);
                ^
              52     } catch (const std::out_of_range &) {
              53         return true;
              54     } catch (...) {
  • One issue which is a false positive that we create deliberately for a sanity check. This one is not found by Debian's version but is by the ArchLinux version (2.3).

Test Plan:
On Debian (1.86) and Arch (2.3):

arc lint --everything

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8909

Details

Provenance
FabienAuthored on Jan 14 2021, 10:22
FabienPushed on Jan 14 2021, 10:36
Reviewer
Restricted Project
Differential Revision
D8909: [LINTER] Fix a couple cppcheck issues
Parents
rABC551e9f7fc168: [Cashtab] hide scrollbar in extension
Branches
Unknown
Tags
Unknown