Skip to content

Commit

Permalink
Added basic cppcheck static analisys
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Oct 13, 2023
1 parent f4ea778 commit 3f08e6b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test-cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Cppcheck static analysis

on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

jobs:
cppcheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: false

- name: install cppcheck
run: sudo apt-get install --no-install-recommends -y -q cppcheck

- name: Run cppcheck static analysis
run: |
make cppcheck
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ line-count-nrf52:
line-count-x86:
cloc --force-lang-def cloc_lang_def.txt src/boot_x86_fsp.c src/boot_x86_fsp_payload.c src/boot_x86_fsp_start.S src/image.c src/keystore.c src/libwolfboot.c src/loader.c src/string.c src/update_disk.c src/x86/ahci.c src/x86/ata.c src/x86/common.c src/x86/gpt.c src/x86/hob.c src/pci.c src/x86/tgl_fsp.c hal/x86_fsp_tgl.c hal/x86_uart.c

cppcheck:
cppcheck -f --suppress="ctunullpointer" --suppress="nullPointer" --suppress="objectIndex" --suppress="comparePointers" --std=c89 src/*.c hal/*.c hal/spi/*.c hal/uart/*.c

%.o:%.c
@echo "\t[CC-$(ARCH)] $@"
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $^
Expand Down

0 comments on commit 3f08e6b

Please sign in to comment.