Address cppcheck 2.10 warnings (#2163)

Disable newer cppcheck until we can diagnose this further.
References #2162.
This commit is contained in:
Andrew Gaul 2023-06-25 16:04:16 +09:00 committed by GitHub
parent 45e7cd085a
commit 3b6688253f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -101,8 +101,8 @@ jobs:
- name: Cppcheck - name: Cppcheck
run: | run: |
# work around resource leak false positives on older Linux distributions # work around resource leak false positives on older and newer Linux distributions
if cppcheck --version | awk '{if ($2 <= 1.86) { exit(1) } }'; then if cppcheck --version | awk '{if ($2 <= 1.86 || $2 >= 2.10) { exit(1) } }'; then
make cppcheck make cppcheck
fi fi

View File

@ -44,6 +44,7 @@ cppcheck:
--enable=warning,style,information,missingInclude \ --enable=warning,style,information,missingInclude \
--suppress=missingIncludeSystem \ --suppress=missingIncludeSystem \
--suppress=unmatchedSuppression \ --suppress=unmatchedSuppression \
--suppress=useStlAlgorithm \
src/ test/ src/ test/
# #

View File

@ -151,9 +151,7 @@ bool AdditionalHeader::Load(const char* file)
addheadlist.push_back(paddhead); addheadlist.push_back(paddhead);
// set flag // set flag
if(!is_enable){ is_enable = true;
is_enable = true;
}
} }
return true; return true;
} }

View File

@ -320,7 +320,7 @@ bool FdManager::HaveLseekHole()
} }
FdManager::checked_lseek = true; FdManager::checked_lseek = true;
FdManager::have_lseek_hole = false; FdManager::have_lseek_hole = false;
return FdManager::have_lseek_hole; return false;
} }
// check SEEK_DATA/SEEK_HOLE options // check SEEK_DATA/SEEK_HOLE options