doc: Fix wrong code in WITH_LOCK doxygen comment
What changed, and why it matters
This commit only fixes a typo in a documentation comment. The code examples inside the comment had an extra 'return {' that made them syntactically invalid. No actual program code was changed, so there is no security effect.
No action needed; this is a documentation-only correction.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates two lines in src/sync.h inside a Doxygen comment for the WITH_LOCK macro. It removes stray ‘return {’ text so the commented example code is syntactically correct. The macro implementation and any compiled code are unchanged.
Changed components
src/sync.h (documentation comment only)Inspect captured patch +2 / −2
diff --git a/src/sync.h b/src/sync.h
index e73a9022..01e92e6e 100644
--- a/src/sync.h
+++ b/src/sync.h
@@ -277,11 +277,11 @@ inline MutexType* MaybeCheckNotHeld(MutexType* m) LOCKS_EXCLUDED(m) LOCK_RETURNE
//! Since the return type deduction follows that of decltype(auto), while the
//! deduced type of:
//!
-//! WITH_LOCK(cs, return {int i = 1; return i;});
+//! WITH_LOCK(cs, int i = 1; return i);
//!
//! is int, the deduced type of:
//!
-//! WITH_LOCK(cs, return {int j = 1; return (j);});
+//! WITH_LOCK(cs, int j = 1; return (j));
//!
//! is &int, a reference to a local variable
//!
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.