Skip to content

Commit 591e9a5

Browse files
committed
fixed #14000 - deprecated the usage of rules [skip ci]
1 parent 8f3d36a commit 591e9a5

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ ifeq ($(HAVE_RULES),yes)
150150
else
151151
LIBS=$(shell $(PCRE_CONFIG) --libs)
152152
endif
153+
$(warning The usage of rules has been deprecated and will be removed in a future Cppcheck version.)
153154
else ifneq ($(HAVE_RULES),)
154155
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
155156
endif

cli/cmdlineparser.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
#ifdef HAVE_RULES
6060
// xml is used for rules
6161
#include "xml.h"
62+
63+
#ifdef _MSC_VER
64+
#pragma message("The usage of rules is deprecated and will be removed in a future Cppcheck version. Please use addons instead.")
65+
#endif
6266
#endif
6367

6468
static bool addFilesToList(const std::string& fileList, std::vector<std::string>& pathNames)
@@ -1258,6 +1262,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
12581262
return Result::Fail;
12591263
}
12601264

1265+
mLogger.printMessage("'--rule' has been deprecated and will be removed in a future Cppcheck version. Please use an addon instead.");
1266+
12611267
mSettings.rules.emplace_back(std::move(rule));
12621268
#else
12631269
mLogger.printError("Option --rule cannot be used as Cppcheck has not been built with rules support.");
@@ -1340,6 +1346,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
13401346
return Result::Fail;
13411347
}
13421348

1349+
mLogger.printMessage("'--rule-file' has been deprecated and will be removed in a future Cppcheck version. Please use an addon instead.");
1350+
13431351
mSettings.rules.emplace_back(std::move(rule));
13441352
}
13451353
} else {

cmake/options.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ if(NOT BUILD_GUI)
8080
endif()
8181

8282
option(HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF)
83+
if(HAVE_RULES)
84+
message(WARNING "The usage of rules has been deprecated and will be removed in a future Cppcheck version. Please use addons instead.")
85+
endif()
8386
option(USE_BUNDLED_TINYXML2 "Usage of bundled TinyXML2 library" ON)
8487
if(BUILD_CORE_DLL AND NOT USE_BUNDLED_TINYXML2)
8588
message(FATAL_ERROR "Cannot use external TinyXML2 library when building lib as DLL")

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Deprecations:
1616
- Support for building with Qt 5 will be removed in Cppcheck 2.19.
1717
- The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead.
1818
- The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead.
19+
- The usage of rules has been deprecated and will be removed in a future Cppcheck version. Please use addons instead.
1920
-
2021

2122
Other:

tools/dmake/dmake.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ int main(int argc, char **argv)
746746
<< " else\n"
747747
<< " LIBS=$(shell $(PCRE_CONFIG) --libs)\n"
748748
<< " endif\n"
749+
<< " $(warning The usage of rules has been deprecated and will be removed in a future Cppcheck version. Please use addons instead.)\n"
749750
<< "else ifneq ($(HAVE_RULES),)\n"
750751
<< " $(error invalid HAVE_RULES value '$(HAVE_RULES)')\n"
751752
<< "endif\n\n";

0 commit comments

Comments
 (0)