THIS PROJECT IS NO LONGER MAINTAINED PLEASE SEE THE LESS BUGGY REPLACEMENT AT http://github.com/fundamental/stoat
This is a static analysis tool built upon clang to verify annotated function properties in C/C++ code. It is primarily intended to verify realtime safety of audio processing code, but as the name implies, it shall evolve into something much more general with time.
First make sure you have copies of:
-
llvm/clang 3.5 or better
-
cmake 2.8 or better
Then run
git clone git://github.com/fundamental/sfpv.git cd sfpv mkdir build cd build cmake .. && make && make test
For basic use of sfpv, just pass the file to be tested as an argument. If the file is annotated, then sfpv will validate the properties, otherwise it will be quite useless. Below is an example of annotated functions:
void __attribute__((annotate("!realtime"))) nrt_function(void) {} void __attribute__((annotate("realtime"))) rt_function(void) { nrt_function(); }
Then this program can be tested with
sfpv sample-code.c
As a result of a realtime function calling a non-realtime function, an error will print to indicate the issue.
Please report all bugs to the github issue tracker at:
If possible include a test case for inclusion in the test suite, as this makes fixing bugs much easier.