Skip to content

Commit 3432257

Browse files
committed
Removed deprecated command --append
1 parent fda1f67 commit 3432257

4 files changed

Lines changed: 0 additions & 41 deletions

File tree

cli/cmdlineparser.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,6 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
296296
else if (std::strcmp(argv[i], "-q") == 0 || std::strcmp(argv[i], "--quiet") == 0)
297297
_settings->quiet = true;
298298

299-
// Append user-defined code to checked source code
300-
else if (std::strncmp(argv[i], "--append=", 9) == 0) {
301-
// This is deprecated and will be removed in 1.80
302-
PrintMessage("cppcheck: '--append' is deprecated and will be removed in version 1.80. To supply additional information to cppcheck, use --library or --include.");
303-
304-
const std::string filename = 9 + argv[i];
305-
if (!_settings->append(filename)) {
306-
PrintMessage("cppcheck: Couldn't open the file: \"" + filename + "\".");
307-
return false;
308-
}
309-
}
310-
311299
// Check configuration
312300
else if (std::strcmp(argv[i], "--check-config") == 0) {
313301
_settings->checkConfiguration = true;

lib/cppcheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
272272
Timer t("Preprocessor::getcode", _settings.showtime, &S_timerResults);
273273
codeWithoutCfg = preprocessor.getcode(tokens1, cfg, files, true);
274274
}
275-
codeWithoutCfg += _settings.append();
276275

277276
if (_settings.preprocessOnly) {
278277
if (codeWithoutCfg.compare(0,5,"#file") == 0)

lib/settings.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,3 @@ bool Settings::isEnabled(Severity::SeverityType severity) const
129129
return false;
130130
}
131131
}
132-
133-
bool Settings::append(const std::string &filename)
134-
{
135-
std::ifstream fin(filename.c_str());
136-
if (!fin.is_open()) {
137-
return false;
138-
}
139-
std::string line;
140-
while (std::getline(fin, line)) {
141-
_append += line + "\n";
142-
}
143-
Preprocessor::preprocessWhitespaces(_append);
144-
return true;
145-
}
146-
147-
const std::string &Settings::append() const
148-
{
149-
return _append;
150-
}

lib/settings.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ class CPPCHECKLIB Settings : public cppcheck::Platform {
5656
};
5757

5858
private:
59-
/** @brief Code to append in the checks */
60-
std::string _append;
61-
6259
/** @brief enable extra checks by id */
6360
int _enabled;
6461

@@ -161,12 +158,6 @@ class CPPCHECKLIB Settings : public cppcheck::Platform {
161158
for finding include files inside source files. (-I) */
162159
std::list<std::string> includePaths;
163160

164-
/** @brief assign append code (--append) */
165-
bool append(const std::string &filename);
166-
167-
/** @brief get append code (--append) */
168-
const std::string &append() const;
169-
170161
/** @brief Maximum number of configurations to check before bailing.
171162
Default is 12. (--max-configs=N) */
172163
unsigned int maxConfigs;

0 commit comments

Comments
 (0)