MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / WarnLocalSameAsGlobal

Method WarnLocalSameAsGlobal

source/script.cpp:13396–13407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13394
13395
13396void Script::WarnLocalSameAsGlobal(LPCTSTR aVarName)
13397// Relies on the following pre-conditions:
13398// 1) It is an implicit (not declared) variable.
13399// 2) Caller has verified that a global variable exists with the same name.
13400// 3) g_Warn_LocalSameAsGlobal is on (true).
13401// 4) g->CurrentFunc is the function which contains this variable.
13402{
13403 auto func_name = g->CurrentFunc ? g->CurrentFunc->mName : _T("");
13404 TCHAR buf[DIALOG_TITLE_SIZE];
13405 sntprintf(buf, _countof(buf), _T("%s (in function %s)"), aVarName, func_name);
13406 ScriptWarning(g_Warn_LocalSameAsGlobal, WARNING_LOCAL_SAME_AS_GLOBAL, buf);
13407}
13408
13409
13410

Callers

nothing calls this directly

Calls 1

sntprintfFunction · 0.85

Tested by

no test coverage detected