From 03f853f8da4177c6469bc38753445c1180793651 Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 12 Sep 2023 21:45:37 +0200 Subject: [PATCH] added script to run Cppcheck with run-time generated platform and defines --- tools/defines/readme.md | 4 +++- tools/defines/run_cppcheck.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tools/defines/run_cppcheck.sh diff --git a/tools/defines/readme.md b/tools/defines/readme.md index 7865bb57681c..ed9d372c0919 100644 --- a/tools/defines/readme.md +++ b/tools/defines/readme.md @@ -17,4 +17,6 @@ Outputs the defines provided by `limits.h`/`climits`. - `stdint.c` Outputs the defines provided by `stdint.h`/`cstdint`. - `create_platform_cfg.sh` -Generates a platform file from the given compiler which can be given to Cppcheck via `--platform`. \ No newline at end of file +Generates a platform file from the given compiler which can be given to Cppcheck via `--platform`. +- `run_cppcheck.sh` +Generates the compiler-specific configurations for the given compiler and runs Cppcheck with them. \ No newline at end of file diff --git a/tools/defines/run_cppcheck.sh b/tools/defines/run_cppcheck.sh new file mode 100644 index 000000000000..af0567c58320 --- /dev/null +++ b/tools/defines/run_cppcheck.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# TODO: use temporary filename +./create_platform_cfg.sh > platform.cfg + +# TODO: add option to pass define to cppcheck +./defines.sh > defines.txt + +./cppcheck --platform=platform.cfg "$@" \ No newline at end of file