Added basic cppcheck static analisys

pull/380/head
Daniele Lacamera 2023-10-13 15:36:26 +02:00
parent 8d882bc898
commit 011fbe7296
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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) $@ $^