annotation-required
Default severity: warning · Identifier: weavec::annotation-required
What it means
Section titled “What it means”On by default: call to '<f>' is not checked: it has no definition or ownership annotations here, once per callee per program (RFC 0005: a definition in any unit analysed together with this one counts; alone, the unit is the program), for a callee with pointer parameters or a pointer result that has no body in the program, no annotations and no libc entry; callees from system headers are exempt. Notes: '<f>' is declared here, annotate its pointer parameters with WEAVEC_OWNED, WEAVEC_BORROWED, WEAVEC_MUT or WEAVEC_RAW, or define it in this program. Likewise call through '<fp>' is not checked: its function type has no ownership annotations and no function of that type has its address taken in this program, once per function-pointer type. With --strict-externs these calls are unsafe-operation errors instead (at every call site, including callees from system headers), and their pointer result is raw. With --report-unannotated: every exported (non-static) definition additionally gets pointer parameter '<p>' of '<f>' is inferred WEAVEC_OWNED; add the annotation to its declaration (or WEAVEC_BORROWED / WEAVEC_MUT; return value of '<f>' is inferred ...) with a fix-it that inserts the annotation, or pointer parameter '<p>' has no inferable ownership; annotate it with WEAVEC_OWNED, WEAVEC_BORROWED or WEAVEC_MUT when the body gives no evidence.
How to resolve it
Section titled “How to resolve it”Make the boundary explicit with an accurate annotation or supply the callee’s definition to whole-program analysis. When the contract cannot be established, retain a documented unsafe boundary. Report-unannotated mode can suggest inferred annotations for exported interfaces.