Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cppcheck to v2.11 #2737

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
CC: gcc
# This is required to use a version of cppcheck other than that
# supplied with the operating system
CPPCHECK_VER: "2.10"
CPPCHECK_VER: "2.11"
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
steps:
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
Expand Down
2 changes: 1 addition & 1 deletion librfxcodec
Submodule librfxcodec updated 1 files
+1 −1 tests/rfxencode.c
8 changes: 8 additions & 0 deletions scripts/install_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ fi
fi
esac

# Use all available CPUs
if [ -f /proc/cpuinfo ]; then
cpus=`grep ^processor /proc/cpuinfo | wc -l`
if [ -n "$cpus" ]; then
make_args="$make_args -j $cpus"
fi
fi

echo "Making cppcheck..."
# CFGDIR is needed for cppcheck before 1.86
call_make $make_args
Expand Down
8 changes: 7 additions & 1 deletion scripts/run_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ if [ -z "$CPPCHECK_FLAGS" ]; then
CPPCHECK_FLAGS="--quiet --force --std=c11 --std=c++11 --inline-suppr \
--enable=warning --error-exitcode=1 -i third_party"
fi
CPPCHECK_FLAGS="$CPPCHECK_FLAGS -D__cppcheck__"

# Any options/directories specified?
if [ $# -eq 0 ]; then
set -- -j 2 .
if [ -f /proc/cpuinfo ]; then
cpus=$(grep '^processor' /proc/cpuinfo | wc -l)
else
cpus=2
fi
set -- -j $cpus .
fi

# Display the cppcheck version and command for debugging
Expand Down
5 changes: 5 additions & 0 deletions sesman/tools/authtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
#include "os_calls.h"
#include "string_calls.h"

// cppcheck doesn't always set this macro to something in double-quotes
#if defined(__cppcheck__)
#undef PACKAGE_VERSION
#endif

#if !defined(PACKAGE_VERSION)
#define PACKAGE_VERSION "???"
#endif
Expand Down
5 changes: 5 additions & 0 deletions sesman/tools/sesrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@

#include "tools_common.h"

// cppcheck doesn't always set this macro to something in double-quotes
#if defined(__cppcheck__)
#undef PACKAGE_VERSION
#endif

#if !defined(PACKAGE_VERSION)
#define PACKAGE_VERSION "???"
#endif
Expand Down
2 changes: 1 addition & 1 deletion vrplayer/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Decoder : public QObject

signals:

public slots:
public slots: // cppcheck-suppress unknownMacro
void onGeometryChanged(QRect *geometry);
};

Expand Down
2 changes: 1 addition & 1 deletion vrplayer/dlgabout.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DlgAbout : public QDialog
private:
Ui::DlgAbout *ui;

private slots:
private slots: // cppcheck-suppress unknownMacro
void onOk();
};

Expand Down
2 changes: 1 addition & 1 deletion vrplayer/playaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PlayAudio : public QObject

void setVcrOp(int op);

public slots:
public slots: // cppcheck-suppress unknownMacro
void play();

private:
Expand Down
2 changes: 1 addition & 1 deletion vrplayer/playvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PlayVideo : public QObject
//void setVcrOp(int op);
//void onMediaRestarted();

public slots:
public slots: // cppcheck-suppress unknownMacro
void play();

//signals:
Expand Down