Page MenuHomePhabricator

[LINTER] Fix a couple cppcheck issues
ClosedPublic

Authored by Fabien on Jan 14 2021, 10:25.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCdbf620770d69: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable