Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p0u4a/rocket-safe
Static analyser for shipping to the moon
https://github.com/p0u4a/rocket-safe
clang nasa rust static-code-analyzer
Last synced: about 1 month ago
JSON representation
Static analyser for shipping to the moon
- Host: GitHub
- URL: https://github.com/p0u4a/rocket-safe
- Owner: P0u4a
- Created: 2024-08-23T14:56:39.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-11-17T07:48:23.000Z (2 months ago)
- Last Synced: 2024-11-17T08:29:57.415Z (2 months ago)
- Topics: clang, nasa, rust, static-code-analyzer
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rocket Safe 🚀
Static analyser for shipping to the moon.
## How it works
Using the Abstract Syntax Tree generated by Clang, the program recursively traverses this tree to detect any C code
that violates a select set of rules from [NASA's Power of 10](https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code). These standards are designed to ensure that embedded code written in C for safety-critical applications, such as those used in rockets, is as easy to debug and as free from errors as possible.The set of rules currently supported are:
- No complex control flow such as goto, longjmp and setjmp
- No recursion
- No heap allocation
- No global variables
- Check all function return values or cast to void if the return value is useless
- Limit pointer use to a single dereference## Example
```
cargo run -- path/to/main.c
```**Output**
```
Dynamic memory allocation at line 7 column 3 in "main.c"
Function fibonacci called recursively at line 9 column 5 in "main.c"
goto usage at line 16 column 5 in "main.c"
goto usage at line 18 column 5 in "main.c"
return value of printf ignored at line 20 column 3 in "main.c". If the function does not return anything it should be cast to void.
```## Running
1. Build the project with cargo build
2. Test with cargo test
3. Run with cargo run -- `path/to/main.c`