You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extern blocks declare C functions with no safety analysis. Any unsafe C function can be called from Flow with no warning.
extern {
function system(cmd: string) -> i32
function gets(buf: ptr<i8>) -> ptr<i8>
}
The type checker (src/flow/parser.py line 2049 parse_extern) accepts any extern declaration. No allowlist. No annotation required.
Standards
MISRA C:2024 Rule 8.1 (Required): Functions shall have prototypes.
MISRA C:2024 Rule 8.7 (Required): Functions and objects should not be defined with external linkage if they are not referenced by another translation unit.
CERT C multiple rules on unsafe C library functions.
Implemented: Under --profile safety/flight, extern declarations now require @unsafe. The type checker has a DANGEROUS_EXTERN_NAMES set (system, gets, strcpy, strcat, sprintf, vsprintf, scanf, sscanf, realpath, getwd) that always requires @unsafe, regardless of profile. @safe functions cannot call @unsafe or bare extern functions.
Activity
feat(safety): Phase 2 — certification docs, @safe/@unsafe, analyze
Merge pull request #394 from flooooooooooow/cursor/misra-phase2-b994
godofecht commentedon Aug 10, 2026
Implemented: Under --profile safety/flight, extern declarations now require @unsafe. The type checker has a DANGEROUS_EXTERN_NAMES set (system, gets, strcpy, strcat, sprintf, vsprintf, scanf, sscanf, realpath, getwd) that always requires @unsafe, regardless of profile. @safe functions cannot call @unsafe or bare extern functions.
docs: fix the vacuity check, four broken tutorials, and an unsafe std…