Skip to content

Commit 6df927f

Browse files
committed
chore: exclude underscore placeholder from shadowing linter warnings
Bitcoin uses underscore in util/translation.h for translatable strings but underscores are also a placeholder used in multiple languages, incl. C++. The next commit will be introducing backports, one of them will be placing util/translation.h into validation.h, which is a header used by Dash-specific code. This causes a conflict between the normal usage of underscore as a placeholder and Bitcoin's usage of it as a function name, which is reported by the Dash-specific linter. We need to exclude shadowing warnings from the linter to account for this.
1 parent 5f9f05e commit 6df927f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/lint/lint-cppcheck-dash.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ENABLED_CHECKS=(
2121
"Variable '.*' is assigned a value that is never used."
2222
"Unused variable"
2323
"The function '.*' overrides a function in a base class but is not marked with a 'override' specifier."
24-
# Enabale to catch all warnings
24+
# Enable to catch all warnings
2525
".*"
2626
)
2727

@@ -34,13 +34,14 @@ IGNORED_WARNINGS=(
3434
"src/rpc/.*cpp:.*: note: Function pointer used here."
3535
"src/masternode/sync.cpp:.*: warning: Variable 'pnode' can be declared as pointer to const \[constVariableReference\]"
3636
"src/wallet/bip39.cpp.*: warning: The scope of the variable 'ssCurrentWord' can be reduced. \[variableScope\]"
37-
37+
"src/.*:.*: warning: Local variable '_' shadows outer function \[shadowFunction\]"
3838

3939
"src/stacktraces.cpp:.*: .*: Parameter 'info' can be declared as pointer to const"
4040
"src/stacktraces.cpp:.*: note: You might need to cast the function pointer here"
4141

4242
"[note|warning]: Return value 'state.Invalid(.*)' is always false"
4343
"note: Calling function 'Invalid' returns 0"
44+
"note: Shadow variable"
4445

4546
# General catchall, for some reason any value named 'hash' is viewed as never used.
4647
"Variable 'hash' is assigned a value that is never used."

0 commit comments

Comments
 (0)