1 Overview
There is a simple #lang rince/c for standalone programs.
Rince is not a static analyzer, but it could serve as a tool to instrument C programs at runtime, in a similar manner to valgrind.
1.1 Getting started
Still very much a work-in-progress. Much is missing—
Try this:
#lang racket (require rince/compile rince/link) (define src #<<END int main(int argc, char **argv) { const char *str = "test"; const char *p = str; while (*p) ++p; return p - str; } END ) (define obj (compile src)) (define proc (linkable->executable obj))
(proc) should return 4, the length of "test".
1.2 Running a standalone C program
You can use raco run-c to compile and execute a standalone C program:
raco run-c tests/ok/puts.c |