Skip to content

Commit e3c8bdc

Browse files
authored
fixed #13934 - removed deprecated platforms unix32-unsigned and unix64-unsigned (danmar#7721)
1 parent 2bebf5d commit e3c8bdc

File tree

8 files changed

+24
-60
lines changed

8 files changed

+24
-60
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,16 @@ add_custom_target(copy_addons ALL
9292
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons"
9393
COMMENT "Copying addons files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
9494

95+
add_custom_target(remove_unsigned_platforms ALL
96+
${CMAKE_COMMAND} -E remove -f
97+
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms/unix32-unsigned.xml"
98+
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms/unix64-unsigned.xml"
99+
COMMENT "Removing unsigned platforms files from ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
100+
95101
add_custom_target(copy_platforms ALL
96102
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/platforms"
97103
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms"
104+
DEPENDS remove_unsigned_platforms
98105
COMMENT "Copying platforms files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
99106

100107
if(USE_BUNDLED_TINYXML2)

cli/cmdlineparser.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,18 +1608,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
16081608
mLogger.printError(errstr);
16091609
return Result::Fail;
16101610
}
1611-
1612-
// TODO: remove
1613-
// these are loaded via external files and thus have Settings::PlatformFile set instead.
1614-
// override the type so they behave like the regular platforms.
1615-
if (platform == "unix32-unsigned") {
1616-
mSettings.platform.type = Platform::Type::Unix32;
1617-
mLogger.printMessage("The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead");
1618-
}
1619-
else if (platform == "unix64-unsigned") {
1620-
mSettings.platform.type = Platform::Type::Unix64;
1621-
mLogger.printMessage("The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead");
1622-
}
16231611
}
16241612

16251613
if (defaultSign != '\0')

lib/cppcheck.vcxproj

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@
280280
<Command>xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y
281281
xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y
282282
xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
283-
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
283+
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y
284+
if exist "$(OutDir)platforms\unix32-unsigned.xml" del /q "$(OutDir)platforms\unix32-unsigned.xml"
285+
if exist "$(OutDir)platforms\unix64-unsigned.xml" del /q "$(OutDir)platforms\unix64-unsigned.xml"</Command>
284286
</PostBuildEvent>
285287
</ItemDefinitionGroup>
286288
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
@@ -313,7 +315,9 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
313315
<Command>xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y
314316
xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y
315317
xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
316-
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
318+
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y
319+
if exist "$(OutDir)platforms\unix32-unsigned.xml" del /q "$(OutDir)platforms\unix32-unsigned.xml"
320+
if exist "$(OutDir)platforms\unix64-unsigned.xml" del /q "$(OutDir)platforms\unix64-unsigned.xml"</Command>
317321
</PostBuildEvent>
318322
</ItemDefinitionGroup>
319323
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -354,7 +358,9 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
354358
<Command>xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y
355359
xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y
356360
xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
357-
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
361+
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y
362+
if exist "$(OutDir)platforms\unix32-unsigned.xml" del /q "$(OutDir)platforms\unix32-unsigned.xml"
363+
if exist "$(OutDir)platforms\unix64-unsigned.xml" del /q "$(OutDir)platforms\unix64-unsigned.xml"</Command>
358364
</PostBuildEvent>
359365
</ItemDefinitionGroup>
360366
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
@@ -396,7 +402,9 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
396402
<Command>xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y
397403
xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y
398404
xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
399-
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
405+
xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y
406+
if exist "$(OutDir)platforms\unix32-unsigned.xml" del /q "$(OutDir)platforms\unix32-unsigned.xml"
407+
if exist "$(OutDir)platforms\unix64-unsigned.xml" del /q "$(OutDir)platforms\unix64-unsigned.xml"</Command>
400408
</PostBuildEvent>
401409
</ItemDefinitionGroup>
402410
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

platforms/unix32-unsigned.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

platforms/unix64-unsigned.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ Other:
2020
- Added make variables `CXXOPTS` and `LDOPTS` to extend existing `CXXFLAGS` and `LDFLAGS`.
2121
- Added make variables `CPPOPTS` to extend existing `CPPFLAGS`.
2222
- `CPPFLAGS` are not longer being passed to the linker command for `cppcheck` and `testrunner`.
23+
- Removed deprecated platforms `unix32-unsigned` and `unix64-unsigned`.
2324
-

test/testcmdlineparser.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,9 +1766,8 @@ class TestCmdlineParser : public TestFixture {
17661766
REDIRECT;
17671767
const char * const argv[] = {"cppcheck", "--platform=unix32-unsigned", "file.cpp"};
17681768
ASSERT(settings->platform.set(Platform::Type::Unspecified));
1769-
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
1770-
ASSERT_EQUALS(Platform::Type::Unix32, settings->platform.type);
1771-
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());
1769+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
1770+
ASSERT_EQUALS("cppcheck: error: unrecognized platform: 'unix32-unsigned'.\n", logger->str());
17721771
}
17731772

17741773
void platformUnix64() {
@@ -1783,9 +1782,8 @@ class TestCmdlineParser : public TestFixture {
17831782
REDIRECT;
17841783
const char * const argv[] = {"cppcheck", "--platform=unix64-unsigned", "file.cpp"};
17851784
ASSERT(settings->platform.set(Platform::Type::Unspecified));
1786-
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
1787-
ASSERT_EQUALS(Platform::Type::Unix64, settings->platform.type);
1788-
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());
1785+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
1786+
ASSERT_EQUALS("cppcheck: error: unrecognized platform: 'unix64-unsigned'.\n", logger->str());
17891787
}
17901788

17911789
void platformNative() {

win_installer/cppcheck.wxs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@
149149
<File Id='mips32.xml' Name='mips32.xml' Source='$(var.PtfsDir)\mips32.xml' />
150150
<File Id='cray_sv1.xml' Name='cray_sv1.xml' Source='$(var.PtfsDir)\cray_sv1.xml' />
151151
<File Id='msp430_eabi_large_datamodel.xml' Name='msp430_eabi_large_datamodel.xml' Source='$(var.PtfsDir)\msp430_eabi_large_datamodel.xml' />
152-
<File Id='unix32unsigned.xml' Name='unix32-unsigned.xml' Source='$(var.PtfsDir)\unix32-unsigned.xml' />
153-
<File Id='unix64unsigned.xml' Name='unix64-unsigned.xml' Source='$(var.PtfsDir)\unix64-unsigned.xml' />
154152
</Component>
155153
</Directory>
156154
<Directory Id='AddonsFolder' Name='addons'>

0 commit comments

Comments
 (0)