Skip to content

Commit

Permalink
added script to run Cppcheck with run-time generated platform and def…
Browse files Browse the repository at this point in the history
…ines
  • Loading branch information
firewave committed Oct 11, 2023
1 parent 6070a36 commit 92ddc99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/defines/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
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.
9 changes: 9 additions & 0 deletions tools/defines/run_cppcheck.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 92ddc99

Please sign in to comment.