From dd0b1c540455ba40e44afcb37659570f812f6450 Mon Sep 17 00:00:00 2001 From: ChinYikMing Date: Sat, 2 Nov 2024 21:00:54 +0800 Subject: [PATCH] Test clang-18 static analysis --- .github/workflows/main.yml | 7 ++++--- src/devices/plic.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c4b0ac3..c08d237e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -143,16 +143,17 @@ jobs: - name: set up scan-build run: | sudo apt-get update -q -y - sudo apt-get install -q -y clang clang-tools libsdl2-dev libsdl2-mixer-dev + sudo apt-get install -q -y libsdl2-dev libsdl2-mixer-dev wget https://apt.llvm.org/llvm.sh chmod +x ./llvm.sh sudo ./llvm.sh 18 + sudo apt-get install -q -y clang-18 clang-tools-18 shell: bash - name: run scan-build without JIT - run: make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0 + run: make distclean && scan-build-18 -v -o ~/scan-build --status-bugs --use-cc=clang-18 --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0 - name: run scan-build with JIT run: | - make ENABLE_JIT=1 distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1 + make ENABLE_JIT=1 distclean && scan-build-18 -v -o ~/scan-build --status-bugs --use-cc=clang-18 --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1 compliance-test: needs: [detect-code-related-file-changes] diff --git a/src/devices/plic.c b/src/devices/plic.c index 19f73826..f6f7c85d 100644 --- a/src/devices/plic.c +++ b/src/devices/plic.c @@ -6,9 +6,9 @@ #include #include -#include "plic.h" #include "../riscv.h" #include "../riscv_private.h" +#include "plic.h" void plic_update_interrupts(plic_t *plic) {