Skip to content

Commit 011fbe7

Browse files
committed
Added basic cppcheck static analisys
1 parent 8d882bc commit 011fbe7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cppcheck static analysis
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
cppcheck:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
submodules: false
17+
18+
- name: install cppcheck
19+
run: sudo apt-get install --no-install-recommends -y -q cppcheck
20+
21+
- name: Run cppcheck static analysis
22+
run: |
23+
make cppcheck

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ line-count-nrf52:
328328
line-count-x86:
329329
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
330330

331+
cppcheck:
332+
cppcheck -f --suppress="ctunullpointer" --suppress="nullPointer" --suppress="objectIndex" --suppress="comparePointers" --std=c89 src/*.c hal/*.c hal/spi/*.c hal/uart/*.c
333+
331334
%.o:%.c
332335
@echo "\t[CC-$(ARCH)] $@"
333336
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $^

0 commit comments

Comments
 (0)