Skip to content

va_start names its last parameter, it does not use it: a printf-style function's format is no longer "passed to __builtin_va_start, which no unit defines" (#3174) - #3570

Merged
ehartford merged 1 commit into
mainfrom
va-start-names-its-param
Nov 23, 2026
Merged

ehartford merged 1 commit into
mainfrom
va-start-names-its-param

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Part of #3174 (retention "passed to a callee no unit defines").

va_start(ap, fmt) names the rightmost parameter so the argument list can start after it (C 7.16.1.4); it neither reads nor keeps the value. The scanner recorded fmt as an argument passed to __builtin_va_start, a callee no unit defines, so the proofs counted the format of every printf-style function as retained, and the reason they printed was that false one.

The scanner no longer records va_start's second argument as a use. Its first argument and every other call are recorded as before.

Measured from source builds:

Test: test/internals/va_start_names_its_parameter_test.with asks the scanner for a body's evidence directly: no sink for va_start's parameter name, in the macro spelling and the builtin one, and a real pass of the same parameter still recorded. It fails on main and passes here (an internals test compiles the scanner from the worktree's source, so the failing run was made in a worktree on main).

Battery green (501 s); self-audit and :release-checks green (587 s).

… function's format is no longer "passed to __builtin_va_start, which no unit defines" (#3174)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant