diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 8b4b19d6a718..5ac8429cc1a2 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -1,112 +1,112 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -114,308 +114,308 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -423,53 +423,53 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -477,13 +477,13 @@ - - + + - - + + @@ -492,106 +492,106 @@ - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + @@ -599,227 +599,227 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -828,13 +828,13 @@ - - + + - - + + @@ -842,43 +842,43 @@ - + - + - + - + - + - + - - + + - - + + - - + + @@ -886,45 +886,45 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -934,55 +934,55 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -991,48 +991,48 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 0d3079b8ea06..63ff6e79b7d1 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1039,7 +1039,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) printMessage("Windows 64-bit binaries currently default to the 'win64' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win64' explicitly if you rely on this."); #elif defined(_WIN32) if (SHOW_DEF_PLATFORM_MSG && default_platform) - printMessage("Windows 32-bit binaries currently default to the 'win32A' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win32A' explicitly if you rely on this."); + printMessage("Windows 32-bit binaries currently default to the 'win32a' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win32a' explicitly if you rely on this."); #endif // Print error only if we have "real" command and expect files @@ -1215,9 +1215,9 @@ void CmdLineParser::printHelp() " 32 bit unix variant\n" " * unix64\n" " 64 bit unix variant\n" - " * win32A\n" + " * win32a\n" " 32 bit Windows ASCII character encoding\n" - " * win32W\n" + " * win32w\n" " 32 bit Windows UNICODE character encoding\n" " * win64\n" " 64 bit Windows\n" diff --git a/gui/projectfile.h b/gui/projectfile.h index 3fd3f6a08a1d..4678f9ee4337 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -159,7 +159,7 @@ class ProjectFile : public QObject { /** * @brief Get platform. - * @return Current platform. If it ends with .xml then it is a file. Otherwise it must match one of the return values from @sa cppcheck::Platform::toString() ("win32A", "unix32", ..) + * @return Current platform. If it ends with .xml then it is a file. Otherwise it must match one of the return values from @sa cppcheck::Platform::toString() ("win32a", "unix32", ..) */ QString getPlatform() const { return mPlatform; diff --git a/lib/platform.cpp b/lib/platform.cpp index cf6235c90c63..29036999f423 100644 --- a/lib/platform.cpp +++ b/lib/platform.cpp @@ -159,9 +159,17 @@ bool cppcheck::Platform::set(Type t) bool cppcheck::Platform::set(const std::string& platformstr, std::string& errstr, const std::vector& paths, bool verbose) { - if (platformstr == "win32A") + if (platformstr == "win32A") { + std::cout << "Platform 'win32A' is deprecated and will be removed in Cppcheck 2.14. Please use 'win32a' instead." << std::endl; set(Type::Win32A); - else if (platformstr == "win32W") + } + else if (platformstr == "win32a") + set(Type::Win32A); + else if (platformstr == "win32W") { + std::cout << "Platform 'win32W' is deprecated and will be removed in Cppcheck 2.14. Please use 'win32w' instead." << std::endl; + set(Type::Win32W); + } + else if (platformstr == "win32w") set(Type::Win32W); else if (platformstr == "win64") set(Type::Win64); diff --git a/lib/platform.h b/lib/platform.h index 6d9833240d2f..b2dc43369fa8 100644 --- a/lib/platform.h +++ b/lib/platform.h @@ -153,9 +153,9 @@ namespace cppcheck { case Type::Native: return "native"; case Type::Win32A: - return "win32A"; + return "win32a"; case Type::Win32W: - return "win32W"; + return "win32w"; case Type::Win64: return "win64"; case Type::Unix32: diff --git a/man/cppcheck.1.xml b/man/cppcheck.1.xml index bea2a2809294..19d4df7c92bd 100644 --- a/man/cppcheck.1.xml +++ b/man/cppcheck.1.xml @@ -486,7 +486,7 @@ There are false positives with this option. Each result must be carefully invest Specifies platform specific types and sizes.The available platforms are: - unix3232 bit unix variantunix6464 bit unix variantwin32A32 bit Windows ASCII character encodingwin32W32 bit Windows UNICODE character encodingwin6464 bit Windows + unix3232 bit unix variantunix6464 bit unix variantwin32a32 bit Windows ASCII character encodingwin32w32 bit Windows UNICODE character encodingwin6464 bit Windows By default the platform which was used to compile Cppcheck is used. diff --git a/releasenotes.txt b/releasenotes.txt index be9e51342e4a..b5758df6920e 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -3,4 +3,5 @@ release notes for cppcheck-2.11 - The platform type 'Unspecified' within .cppcheck projects has been deprecated and will be removed in Cppcheck 2.14. Please use 'unspecified' instead. - It is no longer necessary to run "--check-config" to get detailed "missingInclude" and "missingIncludeSystem" messages. They will always be issued in the regular analysis if "missingInclude" is enabled. - "missingInclude" and "missingIncludeSystem" are reported with "-j" is > 1 and processes are used in the backend (default in non-Windows binaries) -- "missingInclude" and "missingIncludeSystem" will now cause the "--error-exitcode" to be applied \ No newline at end of file +- "missingInclude" and "missingIncludeSystem" will now cause the "--error-exitcode" to be applied +- The platform types 'Win32A' and 'Win32W' has been deprecated and will be removed in Cppcheck 2.14. Please use 'win32a' and 'win32w' respectively. \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f057639ebcaa..61b5bf0312ce 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -148,8 +148,8 @@ if (BUILD_TESTS) add_cfg(sqlite3.c) add_cfg(std.c) add_cfg(std.cpp) - add_cfg(windows.cpp NAME windows32A PLATFORM win32A) - add_cfg(windows.cpp NAME windows32W PLATFORM win32W) + add_cfg(windows.cpp NAME windows32A PLATFORM win32a) + add_cfg(windows.cpp NAME windows32W PLATFORM win32w) add_cfg(windows.cpp NAME windows64 PLATFORM win64) add_cfg(wxwidgets.cpp) diff --git a/test/cfg/runtests.sh b/test/cfg/runtests.sh index 0b40098d574d..5fc7fcfab18a 100755 --- a/test/cfg/runtests.sh +++ b/test/cfg/runtests.sh @@ -499,8 +499,8 @@ function check_file { ;; windows.cpp) windows_fn - ${CPPCHECK} ${CPPCHECK_OPT} --platform=win32A --library=$lib ${DIR}$f - ${CPPCHECK} ${CPPCHECK_OPT} --platform=win32W --library=$lib ${DIR}$f + ${CPPCHECK} ${CPPCHECK_OPT} --platform=win32a --library=$lib ${DIR}$f + ${CPPCHECK} ${CPPCHECK_OPT} --platform=win32w --library=$lib ${DIR}$f ${CPPCHECK} ${CPPCHECK_OPT} --platform=win64 --library=$lib ${DIR}$f ;; wxwidgets.cpp) diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index 7fbbbf7ef770..e381039906e3 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -133,7 +133,9 @@ class TestCmdlineParser : public TestFixture { TEST_CASE(stdunknown); TEST_CASE(platformWin64); TEST_CASE(platformWin32A); + TEST_CASE(platformWin32a); TEST_CASE(platformWin32W); + TEST_CASE(platformWin32w); TEST_CASE(platformUnix32); TEST_CASE(platformUnix32Unsigned); TEST_CASE(platformUnix64); @@ -998,6 +1000,15 @@ class TestCmdlineParser : public TestFixture { ASSERT(settings.platform.set(cppcheck::Platform::Type::Unspecified)); ASSERT(defParser.parseFromArgs(3, argv)); ASSERT_EQUALS(cppcheck::Platform::Type::Win32A, settings.platform.type); + ASSERT_EQUALS("Platform 'win32A' is deprecated and will be removed in Cppcheck 2.14. Please use 'win32a' instead.\n", GET_REDIRECT_OUTPUT); + } + + void platformWin32a() { + REDIRECT; + const char * const argv[] = {"cppcheck", "--platform=win32a", "file.cpp"}; + ASSERT(settings.platform.set(cppcheck::Platform::Type::Unspecified)); + ASSERT(defParser.parseFromArgs(3, argv)); + ASSERT_EQUALS(cppcheck::Platform::Type::Win32A, settings.platform.type); ASSERT_EQUALS("", GET_REDIRECT_OUTPUT); } @@ -1007,6 +1018,15 @@ class TestCmdlineParser : public TestFixture { ASSERT(settings.platform.set(cppcheck::Platform::Type::Unspecified)); ASSERT(defParser.parseFromArgs(3, argv)); ASSERT_EQUALS(cppcheck::Platform::Type::Win32W, settings.platform.type); + ASSERT_EQUALS("Platform 'win32W' is deprecated and will be removed in Cppcheck 2.14. Please use 'win32w' instead.\n", GET_REDIRECT_OUTPUT); + } + + void platformWin32w() { + REDIRECT; + const char * const argv[] = {"cppcheck", "--platform=win32w", "file.cpp"}; + ASSERT(settings.platform.set(cppcheck::Platform::Type::Unspecified)); + ASSERT(defParser.parseFromArgs(3, argv)); + ASSERT_EQUALS(cppcheck::Platform::Type::Win32W, settings.platform.type); ASSERT_EQUALS("", GET_REDIRECT_OUTPUT); } @@ -1094,7 +1114,7 @@ class TestCmdlineParser : public TestFixture { ASSERT_EQUALS("cppcheck: Windows 64-bit binaries currently default to the 'win64' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win64' explicitly if you rely on this.\n", GET_REDIRECT_OUTPUT); #elif defined(_WIN32) ASSERT_EQUALS(cppcheck::Platform::Type::Win32A, settings.platform.type); - ASSERT_EQUALS("cppcheck: Windows 32-bit binaries currently default to the 'win32A' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win32A' explicitly if you rely on this.\n", GET_REDIRECT_OUTPUT); + ASSERT_EQUALS("cppcheck: Windows 32-bit binaries currently default to the 'win32a' platform. Starting with Cppcheck 2.13 they will default to 'native' instead. Please specify '--platform=win32a' explicitly if you rely on this.\n", GET_REDIRECT_OUTPUT); #endif CmdLineParser::SHOW_DEF_PLATFORM_MSG = false; diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ee255ad166ba..3acb7c65e85f 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -5433,10 +5433,10 @@ class TestTokenizer : public TestFixture { "float * ptrToFloat ;"; // These types should be defined the same on all Windows platforms - const std::string win32A = tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win32A); - ASSERT_EQUALS(expected, win32A); - ASSERT_EQUALS(win32A, tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win32W)); - ASSERT_EQUALS(win32A, tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win64)); + const std::string win32a = tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win32A); + ASSERT_EQUALS(expected, win32a); + ASSERT_EQUALS(win32a, tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win32W)); + ASSERT_EQUALS(win32a, tokenizeAndStringifyWindows(code, true, cppcheck::Platform::Type::Win64)); } void platformWin32A() {