Merge pull request #2278 from matt335672/cppcheck_28

Bump cppcheck version to 2.8
This commit is contained in:
matt335672 2022-05-27 11:21:43 +01:00 committed by GitHub
commit 690d9e88d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 14 deletions

View File

@ -129,13 +129,15 @@ jobs:
CC: gcc
# This is required to use a version of cppcheck other than that
# supplied with the operating system
CPPCHECK_VER: 2.7
CPPCHECK_VER: 2.8
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
steps:
# This is currently the only way to get a version into
# the cache tag name - see https://github.com/actions/cache/issues/543
- run: |
echo "OS_VERSION=`lsb_release -sr`" >> $GITHUB_ENV
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
# see https://github.com/actions/cache/issues/543
- name: Get operating system name and version.
id: os
run: echo "::set-output name=image::$ImageOS"
shell: bash
- uses: actions/checkout@v2
- name: Cache cppcheck
uses: actions/cache@v2
@ -143,7 +145,7 @@ jobs:
cache-name: cache-cppcheck
with:
path: ~/cppcheck.local
key: ${{ runner.os }}-${{ env.OS_VERSION }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh
- run: ./bootstrap
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER

View File

@ -72,14 +72,18 @@ msg(char *msg1, ...)
static int
show_last_error(void)
{
LPVOID lpMsgBuf;
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&lpMsgBuf, 0, NULL);
msg("GetLastError - %s", lpMsgBuf);
LocalFree(lpMsgBuf);
LPVOID lpMsgBuf = NULL;
DWORD len;
len = FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&lpMsgBuf, 0, NULL);
if (len > 0)
{
msg("GetLastError - %s", lpMsgBuf);
LocalFree(lpMsgBuf);
}
return 0;
}