Repository navigation
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
Conversation
… function's format is no longer "passed to __builtin_va_start, which no unit defines" (#3174)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 recordedfmtas 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:
gzprintf: wasraw: retains param 1 (passed to __builtin_va_start, which no unit defines); nowraw: variadic— the true reason. It stays raw; the false retention is gone and no longer spreads to callers.va_start(five did).curl_mprintf's format is now followed throughcurl_mvfprintf,formatf,parsefmtanddollarstring, where it ends at a real question (an out-pointer of thestrtolkind,*end; Facade proof: 'stored in a global' (187 functions, 14 libraries) and 'stored through a local' (165) read as retention; most are a gzgets-style scratch write or a debug hook #3175).Test:
test/internals/va_start_names_its_parameter_test.withasks the scanner for a body's evidence directly: no sink forva_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-checksgreen (587 s).