Analyze the whole program
A function’s implementation may live in another source file. Whole-program analysis lets the caller use the effects inferred from that definition.
Analyze source files together
Section titled “Analyze source files together”weavec --whole-program main.c buffer.c -- -std=c17 -IincludeFor files with different compiler flags, use their compilation database:
weavec --whole-program -p buildEach translation unit exports summaries. WeaveC combines available definitions and revisits callers as relevant contracts change. A wrapper that releases a resource can therefore invalidate aliases in a different file.
Analyze during linking
Section titled “Analyze during linking”weavec-cc -c buffer.c -o buffer.oweavec-cc -c main.c -o main.oweavec-cc main.o buffer.o -o appThe link step consumes object sidecars and performs whole-program analysis before linking the executable. A cross-file error stops the link. Checking inside a single source file still happens at compile time.
Understand unresolved boundaries
Section titled “Understand unresolved boundaries”Missing definitions and unknown callback targets remain boundaries. An unrelated function with a matching type is not evidence for an unknown callback’s behavior.
--strict-externs makes calls without a definition, annotation, or library summary raw operations. It helps make interfaces explicit, but it is not a substitute for checked obligations.
Use checked builds when selected functions must have complete contracts. Use analysis caching to reuse validated work on repeated runs.
The architecture and object metadata contract are specified by RFC 0005.