Skip to content

Commit d2fb776

Browse files
committed
re-worded some error messages and avoid using product name
1 parent 34b9c45 commit d2fb776

12 files changed

Lines changed: 21 additions & 21 deletions

lib/checkother.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ void CheckOther::commaSeparatedReturnError(const Token *tok)
15061506
" if (x)\n"
15071507
" return a + 1,\n"
15081508
" b++;\n"
1509-
"However it can be useful to use comma in macros. Cppcheck does not warn when such a "
1509+
"However it can be useful to use comma in macros. No warning is reported when such a "
15101510
"macro is then used in a return statement, it is less likely such code is misunderstood.", CWE398, Certainty::normal);
15111511
}
15121512

lib/cppcheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,8 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
12521252

12531253
if (!hasValidConfig && configurations.size() > 1 && mSettings.severity.isEnabled(Severity::information)) {
12541254
std::string msg;
1255-
msg = "This file is not analyzed. Cppcheck failed to extract a valid configuration. Use -v for more details.";
1256-
msg += "\nThis file is not analyzed. Cppcheck failed to extract a valid configuration. The tested configurations have these preprocessor errors:";
1255+
msg = "This file is not analyzed. No working configuration could be extracted. Use -v for more details.";
1256+
msg += "\nThis file is not analyzed. No working configuration could be extracted. The tested configurations have these preprocessor errors:";
12571257
for (const std::string &s : configurationError)
12581258
msg += '\n' + s;
12591259

lib/importproject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings &setti
14281428
else if (strcmp(childname, Settings::SafeChecks::XmlExternalVariables) == 0)
14291429
temp.safeChecks.externalVariables = true;
14301430
else {
1431-
errors.emplace_back("Unknown '" + std::string(Settings::SafeChecks::XmlRootName) + "' element '" + childname + "' in Cppcheck project file");
1431+
errors.emplace_back("Unknown '" + std::string(Settings::SafeChecks::XmlRootName) + "' element '" + childname + "' in Cppcheck GUI project file");
14321432
return false;
14331433
}
14341434
}
@@ -1451,7 +1451,7 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings &setti
14511451
else if (strcmp(name, CppcheckXml::ProjectNameElementName) == 0)
14521452
; // no-op
14531453
else {
1454-
errors.emplace_back("Unknown element '" + std::string(name) + "' in Cppcheck project file");
1454+
errors.emplace_back("Unknown element '" + std::string(name) + "' in Cppcheck GUI project file");
14551455
return false;
14561456
}
14571457
}

lib/mathlib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ std::string MathLib::calculate(const std::string &first, const std::string &seco
12241224
return MathLib::toString(MathLib::toBigNumber(first) ^ MathLib::toBigNumber(second)) + intsuffix(first, second);
12251225

12261226
default:
1227-
throw InternalError(nullptr, std::string("Unexpected action '") + action + "' in MathLib::calculate(). Please report this to Cppcheck developers.");
1227+
throw InternalError(nullptr, std::string("Unexpected action '") + action + "' in MathLib::calculate(). Please report this to the developers.");
12281228
}
12291229
}
12301230

lib/preprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ void Preprocessor::missingInclude(const std::string &filename, unsigned int line
959959
}
960960
ErrorMessage errmsg(std::move(locationList), mFile0, Severity::information,
961961
(headerType==SystemHeader) ?
962-
"Include file: <" + header + "> not found. Please note: Cppcheck does not need standard library headers to get proper results." :
962+
"Include file: <" + header + "> not found. Please note: Standard library headers do not need to be provided to get proper results." :
963963
"Include file: \"" + header + "\" not found.",
964964
(headerType==SystemHeader) ? "missingIncludeSystem" : "missingInclude",
965965
Certainty::normal);

lib/templatesimplifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3152,7 +3152,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
31523152
"templateRecursion",
31533153
"TemplateSimplifier: max template recursion ("
31543154
+ std::to_string(mSettings.maxTemplateRecursion)
3155-
+ ") reached for template '"+typeForNewName+"'. You might want to limit Cppcheck recursion.",
3155+
+ ") reached for template '"+typeForNewName+"'. You might want to adjust the template recursion limit.",
31563156
Certainty::normal);
31573157
mErrorLogger.reportErr(errmsg);
31583158
}

lib/token.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ int multiComparePercent(const Token *tok, const char*& haystack, nonneg int vari
424424
return 1;
425425
} else { // %varid%
426426
if (varid == 0) {
427-
throw InternalError(tok, "Internal error. Token::Match called with varid 0. Please report this to Cppcheck developers");
427+
throw InternalError(tok, "Internal error. Token::Match called with varid 0. Please report this to the developers");
428428
}
429429

430430
haystack += 6;

test/cli/helloworld_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_missing_include_system(): # #11283
360360
]
361361

362362
_, _, stderr = cppcheck(args, cwd=__script_dir)
363-
assert stderr.replace('\\', '/') == 'helloworld/main.c:1:2: information: Include file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem]\n'
363+
assert stderr.replace('\\', '/') == 'helloworld/main.c:1:2: information: Include file: <stdio.h> not found. Please note: Standard library headers do not need to be provided to get proper results. [missingIncludeSystem]\n'
364364

365365

366366
def test_sarif():

test/cli/other_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,7 @@ def test_no_valid_configuration(tmp_path):
40184018
'{}:1:2: error: No header in #include [syntaxError]'.format(test_file),
40194019
'{}:1:2: error: No header in #include [syntaxError]'.format(test_file),
40204020
'{}:1:2: error: No header in #include [syntaxError]'.format(test_file),
4021-
'{}:0:0: information: This file is not analyzed. Cppcheck failed to extract a valid configuration. Use -v for more details. [noValidConfiguration]'.format(test_file)
4021+
'{}:0:0: information: This file is not analyzed. No working configuration could be extracted. Use -v for more details. [noValidConfiguration]'.format(test_file)
40224022
]
40234023

40244024

test/testmathlib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class TestMathLib : public TestFixture {
167167
ASSERT_EQUALS("1", MathLib::calculate("0", "1", '^'));
168168

169169
// Unknown action should throw exception
170-
ASSERT_THROW_INTERNAL_EQUALS(MathLib::calculate("1","2",'j'),INTERNAL, "Unexpected action 'j' in MathLib::calculate(). Please report this to Cppcheck developers.");
170+
ASSERT_THROW_INTERNAL_EQUALS(MathLib::calculate("1","2",'j'),INTERNAL, "Unexpected action 'j' in MathLib::calculate(). Please report this to the developers.");
171171
}
172172

173173
void calculate1() const {

0 commit comments

Comments
 (0)