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

ci(checks): build cppcheck from sources #180

Merged
merged 1 commit into from
Jun 4, 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
40 changes: 37 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,50 @@ jobs:
cppcheck:
runs-on: ubuntu-20.04
name: Static code analysis
env:
cppcheck-version: 2.10.3

steps:
- uses: actions/checkout@v2

- name: Install cppcheck
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -y install libpcre3-dev

- name: Restore cppcheck build
id: cppcheck-build-restore
uses: actions/cache/restore@v3
with:
path: |
${{ github.workspace }}/cppcheck
key: ${{ runner.os }}-cppcheck-${{ env.cppcheck-version }}

- name: Check out cppcheck
uses: actions/checkout@v2
with:
repository: danmar/cppcheck
ref: ${{ env.cppcheck-version }}
path: ${{ github.workspace }}/cppcheck

- name: Compile cppcheck
run: |
sudo apt-get update
sudo apt-get -y install cppcheck
sudo apt-get -y install libpcre3-dev
cd cppcheck
make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
cd -

- name: Save cppcheck build
id: cppcheck-build-save
uses: actions/cache/save@v3
with:
path: |
${{ github.workspace }}/cppcheck
key: ${{ runner.os }}-cppcheck-${{ env.cppcheck-version }}

- name: Check soure code
run: cppcheck -q -f --error-exitcode=1 --inline-suppr src
run: ${{ github.workspace }}/cppcheck/cppcheck -q -f --error-exitcode=1 --inline-suppr src

codespell:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion src/mac/py_proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ _py_proc__get_resident_memory(py_proc_t * self) {
mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT;

return task_info(
self->proc_ref, MACH_TASK_BASIC_INFO, (task_info_t) &info, &count
self->proc_ref, MACH_TASK_BASIC_INFO, (task_info_t) &info, &count // cppcheck-suppress [uninitvar]
) == KERN_SUCCESS
? info.resident_size
: -1;
Expand Down