Bumped cppcheck version to 2.3

addressed resulting warnings
This commit is contained in:
matt335672 2020-12-24 09:44:28 +00:00
parent d8998a0a19
commit 8ab3a2e9f8
4 changed files with 18 additions and 3 deletions

View File

@ -126,8 +126,8 @@ jobs:
env:
CC: gcc
# This is required to use a version of cppcheck other than that
# suplied with the operating system
CPPCHECK_VER: 2.1
# supplied with the operating system
CPPCHECK_VER: 2.3
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
steps:
- uses: actions/checkout@v2
@ -142,4 +142,3 @@ jobs:
- run: ./bootstrap
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER

View File

@ -1799,7 +1799,10 @@ validate (region_type_t * badreg)
*badreg = ri[0].reg;
if (ri != stack_regions)
{
/* cppcheck-suppress autovarInvalidDeallocation */
free (ri);
}
GOOD (badreg);
return ret;
@ -1809,7 +1812,10 @@ bail:
FREE_DATA (&ri[i].reg);
if (ri != stack_regions)
{
/* cppcheck-suppress autovarInvalidDeallocation */
free (ri);
}
return pixman_break (badreg);
}

View File

@ -129,6 +129,12 @@ fi
make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR CFGDIR=$FILESDIR"
;;
*) make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR USE_Z3=yes"
# Check that the Z3 development files appear to be installed
# before trying to create z3_version.h. Otherwise we may
# mislead the user as to what needs to be done.
if [ ! -f /usr/include/z3.h ]; then
echo "** libz3-dev (or equivalent) does not appear to be installed" >&2
fi
if [ ! -f /usr/include/z3_version.h ]; then
create_z3_version_h
fi

View File

@ -273,7 +273,11 @@ xfs_create_xfs_fs(mode_t umask, uid_t uid, gid_t gid)
xfs->free_list = NULL;
xfs->generation = 1;
/* xfs->inode_table check should be superfluous here, but it
* prevents cppcheck 2.2/2.3 generating a false positive nullPointer
* report */
if (!grow_xfs(xfs, INODE_TABLE_ALLOCATION_INITIAL) ||
xfs->inode_table == NULL ||
(xino1 = g_new0(XFS_INODE_ALL, 1)) == NULL ||
(xino2 = g_new0(XFS_INODE_ALL, 1)) == NULL)
{