Repository navigation
hash: two-word locals and parameters in the headers (MSVC C4459 in a user's program), and the user_globals test - #16
Merged
Merged
Conversation
added 7 commits
November 26, 2026 06:27
…local or a parameter, before every public header and a call of every cell, which MSVC's C4459 reports at /W4 /WX
…s (917 declarations of 119 one-word names, which MSVC's C4459 reports in a program with a global of one), the doc comments, kdfs.adoc and AGENTS.md with them; user_globals calls async_pbkdf2 only with threads
…ed, the options const, no key derivation calls on a backend without one, lambdas without an empty parameter list
…the names of their parameters (MrDocs)
…e hkdf-pieces' spec names it (a function template's parameter raises no C4459); the kdfs page with them; libsodium's whole-digest test is writes_whole_digest
…es and the guide quote the new parameter names; OpenSSL's SSKDF and X9.63 engines take fixed_info and shared_info as the public functions do; every @PARAM starts its line and the paragraphs the longer names left short are rewrapped; AGENTS.md cites a real guard and states HKDF's salt
… every completion is posted
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.
MSVC's C4459 ("declaration of 'x' hides global declaration"), an error at /W4 /WX, stopped a user's program that has a global named like a one-word local or parameter of a hash header's function (inline functions always; function templates at their locals when instantiated). Secure's stream found and fixed the same defect in its own headers (its D3).
test/user_globals_test.cpp: a global of every one-word name a header gave a local or a parameter (119, from clang's AST in every configuration: with and without exceptions and threads, the test seams, Emscripten), after every other library's headers and before every hash header, then a call of every cell of every backend and every asynchronous function, which instantiates the templates. Before the fix it failed on MSVC 14.3 x64 debug with 1,001 C4459 errors over 85 names in 20 headers.include/now has two spelled-out words, role then kind (917 declarations, renamed from the AST's declarations and references; the asynchronous machinery as crypto'sdetail/heavy.hppnames it). The doc comments, the engines' interface sketches,doc/async.adocandAGENTS.mdfollow.salt, as the change hkdf-pieces' spec requires; a function template's parameter raises no C4459. The XKCP adapter's C declarations keepsrc/xkcp_adapter.c's names, since a declaration without a body raises none.Verified locally: MSVC 14.3 and 14.5 x64 debug (hash's tests and examples), MSVC 14.5 arm64 (the timing tests), clang, gcc-15, wasip2, wasip3 and Emscripten,
b2 libs/hash/doc, macOS clang-tidy and the Linux lint.