Skip to content

Commit a6c8540

Browse files
authored
fixed #13348 - deprecated unix32-unsigned and unix64-unsigned platforms (danmar#7591)
1 parent 8c1ef55 commit a6c8540

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

cli/cmdlineparser.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,10 +1106,14 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
11061106
// TODO: remove
11071107
// these are loaded via external files and thus have Settings::PlatformFile set instead.
11081108
// override the type so they behave like the regular platforms.
1109-
if (platform == "unix32-unsigned")
1109+
if (platform == "unix32-unsigned") {
11101110
mSettings.platform.type = Platform::Type::Unix32;
1111-
else if (platform == "unix64-unsigned")
1111+
mLogger.printMessage("The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead");
1112+
}
1113+
else if (platform == "unix64-unsigned") {
11121114
mSettings.platform.type = Platform::Type::Unix64;
1115+
mLogger.printMessage("The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead");
1116+
}
11131117
}
11141118

11151119
// Write results in results.plist

releasenotes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Changed interface:
1414

1515
Deprecations:
1616
- Support for building with Qt 5 will be removed in Cppcheck 2.19.
17+
- The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead.
18+
- The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead.
1719
-
1820

1921
Other:

test/testcmdlineparser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,7 @@ class TestCmdlineParser : public TestFixture {
16761676
ASSERT(settings->platform.set(Platform::Type::Unspecified));
16771677
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
16781678
ASSERT_EQUALS(Platform::Type::Unix32, settings->platform.type);
1679+
ASSERT_EQUALS("cppcheck: The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead\n", logger->str());
16791680
}
16801681

16811682
void platformUnix64() {
@@ -1692,6 +1693,7 @@ class TestCmdlineParser : public TestFixture {
16921693
ASSERT(settings->platform.set(Platform::Type::Unspecified));
16931694
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
16941695
ASSERT_EQUALS(Platform::Type::Unix64, settings->platform.type);
1696+
ASSERT_EQUALS("cppcheck: The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead\n", logger->str());
16951697
}
16961698

16971699
void platformNative() {

0 commit comments

Comments
 (0)