Commit Graph

837 Commits

Author SHA1 Message Date
Daniel Marjamäki a0dd853642 analyzing one vs config (first debug config that matches platform) 2019-04-13 20:01:40 +02:00
Daniel Marjamäki b04d1815ed Add -std=c++17 and allow semicolon in 'if ()' 2019-04-12 09:10:25 +02:00
Daniel Marjamäki cb06aebdab Removed --std=posix. From now on, if you use --library=posix then the posix checks will be enabled. 2019-04-12 06:47:28 +02:00
Daniel Marjamäki f6b410b469 GUI: add setting for 'checkHeaders', 'checkUnusedTemplates' and 'maxCtuDepth' to project 2019-04-10 16:49:24 +02:00
Daniel Marjamäki 58d88e149f Add --addon=<addon> command line option 2019-04-07 17:44:43 +02:00
Daniel Marjamäki 7ec8ce2ece --help: arguments should be written in alphabetical order 2019-04-07 13:20:23 +02:00
Daniel Marjamäki 111db91387 ImportProject: Import excluded paths properly 2019-04-07 12:31:52 +02:00
Daniel Marjamäki c04cc02ee5 Refactoring; Use range for loop 2019-04-07 12:07:47 +02:00
Oliver Stöneberg 8d7d93aea7 donate-cpu.py: improved error detection (#1766)
* threadexecutor.cpp: streamlined error messages

* donate-cpu.py: detect additional signals and exitcode != 0 as crash as well and (ab)use elapsedTime to make the errorcode visible in the output / also detect ThreadExecutor issues

* donate-cpu.py: bumped version

* donate-cpu.py: fixed detection of ThreadExecutor errors
2019-03-29 06:53:40 +01:00
Daniel Marjamäki a3257349b9 astyle formatting
[ci skip]
2019-03-17 10:50:06 +01:00
Daniel Marjamäki c7155a8e08 Removed '--experimental-fast' flag 2019-03-17 08:19:56 +01:00
Sebastian 08d41ab8af
Load std.cfg before all other libraries (#1740)
- CLI: Save the libraries that should be loaded to a list and load them
after the std.cfg has been loaded.
- GUI: Load std.cfg (and windows.cfg / posix.cfg when applicable) before
setting other options and loading the other libraries.
In the project-file-dialog the std.cfg is searched first. If some
other library fails to load is is retried with first loading std.cfg.
- boost.cfg: Enable containers that depend on std containers.
2019-03-15 06:59:37 +01:00
Daniel Marjamäki fda0f52424 Add --remove-unused-templates flag to remove all unused templates 2019-03-05 14:58:02 +01:00
Daniel Marjamäki e4249d3811 Clarify help text for --remove-unused-included-headers 2019-03-04 20:07:11 +01:00
Daniel Marjamäki 3675318208 Added --remove-unused-included-templates option 2019-03-04 19:10:49 +01:00
Daniel Marjamäki f5c274b3b1 Added '--check-headers=no' option. 2019-03-02 19:52:15 +01:00
PKEuS 11daabc1a8 Set version to 1.87.99/1.88 dev 2019-02-27 21:30:54 +01:00
Sebastian d1deff7c02 threadexecutor.h: Disable THREADING_MODEL_FORK for Cygwin (trac 8973) (#1670)
The fork implementation in Cygwin seems to be not very reliable.
See also the Cygwin documentation here: https://cygwin.com/faq/faq.html#faq.using.fixing-fork-failures
More details in the ticket https://trac.cppcheck.net/ticket/8973
2019-02-15 21:47:33 +01:00
Daniel Marjamäki 6717f49f20 Try to give some credit to the 3rd party libraries we use. 2019-02-10 17:16:53 +01:00
Daniel Marjamäki 4f232e41dd Add --experimental-fast option 2019-02-09 14:40:50 +01:00
Daniel Marjamäki 502d5e9142 1.87: Set versions 2019-02-09 09:07:27 +01:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki 437800f46d CLI: Added --max-ctu-depth 2019-02-03 17:51:36 +01:00
Daniel Marjamäki 961f66baff Fixed #8820 (import GUI project)
This has basic handling of GUI projects. But further work will be needed to handle addons etc, the plan is that we will be able to run addons from the command line soon.
2019-01-31 20:40:21 +01:00
Daniel Marjamäki d35a26c6f0 --check-library fix 2019-01-22 19:40:39 +01:00
Daniel Marjamäki 4119cfd3d1 Correct exit code when there are no unmatched suppressions 2019-01-21 20:33:22 +01:00
Daniel Marjamäki 0f19dfea82 Do not check unmatched suppressions in --check-library checking 2019-01-20 10:30:38 +01:00
Daniel Marjamäki 0945e827c6 Fixed #8931 (Missing error exitcode when an unmatched suppression is detected) 2019-01-19 21:42:01 +01:00
Paul Fultz II 9e4b605fca Properly find pcre (#1607) 2019-01-18 21:13:35 +01:00
IOBYTE f0cfe03f7b template simplifier: add cli --debug-template option to print the parsed template information (#1598) 2019-01-14 08:29:32 +01:00
Daniel Marjamäki ade18d978a Inline suppression for knownConditionTrueFalse FP 2019-01-13 13:18:35 +01:00
Daniel Marjamäki 900e26f651 Fix Cppcheck warning
[ci skip]
2019-01-13 13:06:51 +01:00
Daniel Marjamäki 792419a591 Use OVERRIDE macro in cli 2019-01-12 15:42:50 +01:00
Paul Fultz II 800076f9b8 Install to the correct cfgdir (#1593) 2019-01-12 08:05:03 +01:00
Daniel Marjamäki 5051744304 astyle formatting
[ci skip]
2019-01-09 19:47:46 +01:00
vahtis 5fc7fadf84 SunOs 11 compatibility with dirent (#1574)
* SunOs 11 compatibility issue solved. Member d_type is a BSD extension

* Added test for BSD also.

* Extra empty lines removed
2019-01-08 21:17:04 +01:00
Sebastian b51f19d530
Fix some doxygen warnings/issues in the comments (#1537) 2018-12-21 21:23:03 +01:00
PKEuS 886aa07ffb Set version to 1.86.99/1.87 dev 2018-12-08 11:53:37 +01:00
Daniel Marjamäki 5e527bdd08 Update version 2018-12-08 08:17:05 +01:00
amai2012 52d042fd48 Correct file size calculation 2018-11-30 23:18:51 +01:00
Daniel Marjamäki 895772711a 1.85: Set version 2018-10-13 18:55:19 +02:00
IOBYTE 24f2e288d5 Make --debug alias --debug-normal for backwards compatibility. (#1414) 2018-10-09 14:47:50 +02:00
orbitcowboy 361ae311f6 cmdlineparser: Stop processing in case an invalid path for --includes-file=<PATH> and --config-excludes-file=<PATH> is provided. 2018-09-04 16:37:43 +02:00
Kamil Dudka 0ca6ab1a71 ErrorLogger: add {cwe} (#1341) 2018-08-21 13:58:19 +02:00
Daniel Marjamäki 19af19b15e doxygen: Updated documentation shown on main page 2018-08-18 17:36:40 +02:00
Daniel Marjamäki 67e9a9cb25 naming convention conformance 2018-08-18 15:52:18 +02:00
Daniel Marjamäki 5ebfa035aa Updated variable names according to naming convention 2018-08-18 15:45:42 +02:00
Daniel Marjamäki ddbe4b89b5 Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
firewave 01ceb9bae7 fixed issue 8661: Misleading error message when compilation database is not recognized 2018-07-25 16:26:25 +02:00
orbitcowboy f27baf0956 cli: stop processing in case an invalid or non-existant rule-file is provided. 2018-07-25 08:25:18 +02:00
Olivier Croquette b05ae44edb Fix link error when building with MinGW about __imp_PathFileExistsA (#1310)
Following error occurs when building with MinGW 7.2.0 and Ninja on Windows:

  cli/CMakeFiles/cli_objs.dir/filelister.cpp.obj: In function `MyIsDirectory':
  cppcheck-1.84\build/../cli/filelister.cpp:49: undefined reference to `__imp_PathIsDirectoryA'
  cli/CMakeFiles/cli_objs.dir/filelister.cpp.obj: In function `MyFileExists':
  cppcheck-1.84\build/../cli/filelister.cpp:67: undefined reference to `__imp_PathFileExistsA'
  collect2.exe: error: ld returned 1 exit status

This is the corresponding code in filelister.cpp:

  #ifdef _WIN32

  // snip

  static BOOL MyIsDirectory(const std::string& path)
  {
  #ifdef __BORLANDC__
      return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY);
  #else
  // See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
      return PathIsDirectoryA(path.c_str());
  #endif
  }

  static BOOL MyFileExists(const std::string& path)
  {
  #ifdef __BORLANDC__
      DWORD fa = GetFileAttributes(path.c_str());
      BOOL result = FALSE;
      if (fa != INVALID_FILE_ATTRIBUTES && !(fa & FILE_ATTRIBUTE_DIRECTORY))
	  result = TRUE;
  #else
      const BOOL result = PathFileExistsA(path.c_str());
  #endif
      return result;
  }

The else blocks assume that Shlwapi.lib is available on Windows except with Borland,
so the patch set ensures that the library is linked on the same condition.
2018-07-15 22:26:02 +02:00
PKEuS 009287f912 Set version to 1.84.99/1.85 dev 2018-06-25 21:03:43 +02:00
Daniel Marjamäki a21c05edfe 1.84: Set versions
[ci skip]
2018-06-10 22:21:57 +02:00
Daniel Marjamäki 45379a3aa6 Updated copyright year for modified files
[ci skip]
2018-06-10 22:07:21 +02:00
bwoester 9b28499412 Import BCB6 projects (#1245)
* added support for reading borland c++ builder 6 projects

* add: fetch sysdefines from project
add: start providing bcb6 predefines (WIP)

* configure all the internal defines for BCB6

* make sure define strings don't start with ';'

* improvements on bwoesters BCB6 project support

- improved `*.bpr` XML handling by reducing the number of loops
- added `const` where aplicable
- optimized compiler argument parser performance
- reformatted code with provided astyle config

* - undo looping (keep it the same as the other implementations)
- keep parsing of cflags simple and separate from the synonym cleanup (no need for micro optimization in this place)
- move input validation to FileSettings::setDefines
- re-run astyle

* use [] instead of at() when comparing characters
2018-05-20 18:19:20 +02:00
IOBYTE ce50df8047 Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
Daniel Marjamäki cdf7ea0a33 daca2: remove {code} in results 2018-04-24 16:16:45 +02:00
Daniel Marjamäki cf4367d013 daca2: remove 'inconclusive' keyword 2018-04-24 11:06:25 +02:00
Daniel Marjamäki 7c5058a42d Refactoring. Rename methods 2018-04-23 12:39:47 +02:00
Daniel Marjamäki f058d9ad08 CLI: Added more fields for --template and added a new --template-location. The gcc predefined template now matches latest gcc better. 2018-04-23 12:21:18 +02:00
PKEuS b596b0d549 Refactorization: pass std::string directly to std::*fstream 2018-04-11 09:50:42 +02:00
PKEuS d2146844dd Refactorizations:
- Replace several push_back-calls by emplace_back
- Replace some x = x.substr(0, y) calls by x.erase(y)
2018-04-11 09:44:35 +02:00
Daniel Marjamäki a0906140a6 Suppressions: New extensible Suppressions xml format that allow more attributes. To start with it also allows symbolName. 2018-04-09 06:43:48 +02:00
PKEuS a5162e26e8 Set minimum required compilers to GCC 4.6 or Visual Studio 2013 to support more C++11 features. Use VS 2013 and VS 2017 in AppVeyor. 2018-04-08 23:03:57 +02:00
PKEuS e2002db78d Replaced make_container by C++11 initializer lists 2018-04-08 23:03:44 +02:00
jrp2014 c2e54fa87f Refactor cli/cppcheckexecutor.cpp 2018-04-05 08:12:15 +02:00
jrp2014 b813a6d407 Refactoring 2018-04-04 21:11:23 +02:00
jrp2014 07b5afcdc6 Improve constness 2018-04-04 21:02:13 +02:00
amai dab99e83cd (Re-)Enable exception handling on cygwin 2018-04-03 00:41:13 +02:00
PKEuS 32a2060f14 Set version to 1.83.99/1.84 dev
Updated copyright year in version.h
2018-04-02 15:21:37 +02:00
Daniel Marjamäki 7260be81a6 Update version 2018-03-31 21:25:29 +02:00
Daniel Marjamäki 7e4dba6a7e Updated copyright year 2018-03-31 20:59:09 +02:00
Daniel Marjamäki e9fefcac46 gcc 4.5 compatibility 2018-03-30 21:04:32 +02:00
Daniel Marjamäki 25ef18ab11 astyle formatting
[ci skip]
2018-03-22 07:14:01 +01:00
amai2012 ab02595be1 Improve debug output in case of SIGABRT (add hint about assertion) and small refactoring 2018-03-20 14:24:45 +01:00
Daniel Marjamäki 46307df9b6 Renamed method 2018-03-11 15:06:08 +01:00
orbitcowboy 50844aa7fc checkType: Take into account the size of char. 2018-02-18 14:28:48 +01:00
Sebastian 78cceea8f6
dmake: Fix windows project and build (#1091)
Replace legacy dmake.vcproj with according .sln and .vcxproj files.
Update windows code in filelister.cpp so dmake compiles and works again.
2018-02-17 06:31:12 +01:00
Daniel Marjamäki db274e8308 Fix testrunner in cygwin 2018-02-10 15:34:49 +01:00
Daniel Marjamäki 780bd7e63e More flexible loading of platform files, when using --platform it should not be necessary to provide the full path 2018-02-09 16:22:22 +01:00
Matthias Krüger f009cfc845 fix some typos found by codespell. 2018-02-04 20:53:43 +01:00
Daniel Marjamäki 2f508c0bba 1.82: Updated versions 2018-01-14 16:25:17 +01:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Ivan Maidanski 97ffec85c0 Fixed #7502 (Correct exit code if never used function is found) (#1026) 2018-01-12 08:24:01 +01:00
BNT fd76abba16 also generate debug information when building for release. This makes (#1003)
debugging and profiling easier and has now drawback as long as the PDB
files are not distributed (which would blow up installers)
2017-11-29 08:31:30 +01:00
amai2012 2f2172e1a7 #8178 Remove all references to XML version 1 2017-11-22 10:49:59 +01:00
Ali Can Demiralp bf174f583b Link to Shlwapi.lib on MSVC to get rid of missing symbol issues. (#978) 2017-10-18 17:38:15 +02:00
Dmitry-Me 93e5140945 Better variable names 2017-10-14 23:05:58 +03:00
PKEuS a29b33b833 Set version to 1.81.99/1.82 dev 2017-10-07 23:22:31 +02:00
Daniel Marjamäki cebf34e718 1.81: Set versions 2017-10-07 12:55:36 +02:00
Oleksandr Redko 2bee664ec9 Return non-const object to enable move compiler optimization (#966) 2017-10-03 18:24:18 +02:00
Daniel Marjamäki 9f306cf3aa Added C++14 option 2017-09-22 22:00:00 +02:00
Ayaz Salikhov 2604156fe7 Use C++ headers (#949) 2017-09-07 13:02:44 +02:00
Ayaz Salikhov 76dc828e24 Use nullptr (#950)
Refactoring: use nullptr
2017-09-07 10:33:52 +02:00
Daniel Marjamäki 1a1f2069e9 astyle formatting
[ci skip]
2017-08-30 17:42:04 +02:00
Dmitry-Me 9d41b272a1 Brace macro parameter 2017-08-29 21:23:45 +03:00
Dmitry-Me 6f0d5aaee3 Adapt to cases when conversion is a no-op 2017-08-29 21:21:48 +03:00
Dmitry-Me c9e2b56b08 Make code easier to debug 2017-08-29 17:51:56 +03:00
Dmitry-Me b6c218b7af Resolve CID 1365360
Do not ignore failures to load windows.cfg
2017-08-22 18:09:02 +03:00
Heiko Eißfeldt de9f8b8a3c refactoring ansiToOEM 2017-08-22 13:15:11 +02:00