Commit Graph

200 Commits

Author SHA1 Message Date
Oliver Stöneberg 8ef14dad98
fixed and enabled `performance-faster-string-find` clang-tidy warning (#4769) 2023-02-08 21:01:51 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 8cc3e0b2ff
errortypes.h: use `enum class` instead of wrapping types into classes (#4693) 2023-01-08 19:31:54 +01:00
Oliver Stöneberg 1cfe49e340
use `const_iterator` where possible (#4662) 2022-12-30 15:13:47 +01:00
Oliver Stöneberg 3c68b9b29f
use `cbegin()` and `cend()` with `const_ierator` loops (#4658) 2022-12-20 20:32:16 +01:00
Oliver Stöneberg 40a69e5afb
optimized deserializing of `ErrorMessage` and related main process code (#4610) 2022-12-09 19:34:51 +01:00
Oliver Stöneberg 4103d05c7f
improved `ErrorMessage::deserialize()` error messages (#4617) 2022-12-07 18:00:45 +01:00
Oliver Stöneberg 7d3ce62ee9
improved errorhandling related to deserializing `ErrorMessage` (#4604) 2022-12-03 15:44:33 +01:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references (#4529)
* applied `misc-const-correctness` fixes for POD types and iterators

* applied `misc-const-correctness` fixes for references
2022-10-02 07:12:40 +02:00
Oliver Stöneberg b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes (#4466)
* iwyu.yml: use debian:unstable to always get latest include-what-you-use

* cleaned up includes based on include-what-you-use

* mitigated include-what-you-use false positives
2022-09-16 07:15:49 +02:00
Oliver Stöneberg d46ea7ba86
avoid unnecessary copies with `push_back()` and `push_front()` (#4451) 2022-09-08 09:21:35 +02:00
Oliver Stöneberg 16f598c409
added missing `sstream` includes (#4381) 2022-08-19 10:16:23 +02:00
Oliver Stöneberg c54b3f4de0
removed leftover bughunting GUI related fields from `ErrorMessage` (#4351) 2022-08-13 08:27:52 +02:00
Oliver Stöneberg b65b47d3a8
enabled and fixed `modernize-pass-by-value` clang-tidy warnings (#4169) 2022-07-28 22:51:45 +02:00
chrchr-github 47c2a01392
Fix #11166 inefficient way to remove last character from std::string (#4267)
* Fix #11166 inefficient way to remove last character from std::string

* Format

* Modify message, add test

* Format

* Fix another warning
2022-07-11 23:07:37 +02:00
Daniel Marjamäki d1812c8022 Cppcheck: Write product name if provided in xml output 2022-07-07 17:35:13 +02:00
Daniel Marjamäki 68bb724dcc ErrorLogger: do not allocate huge std::string when column is -1 2022-07-07 15:07:17 +02:00
Daniel Marjamäki 8f386e15fd Remove bug hunting. This feature will be provided in Cppcheck premium. 2022-04-11 07:31:33 +02:00
Bart vdr. Meulen 20601c1b01 Restore symbol names from cache
When reading earlier reported errors from the cache file the symbol names are not handled. This causes suppressions to no longer match when rerunning cppcheck.
2022-02-21 18:19:05 +01:00
Oliver Stöneberg 6e57cc4323
small utils.h cleanup (#3821) 2022-02-11 19:44:08 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 8f7770f512
added an include-what-you-use GitHub Action (#3759) 2022-02-01 17:19:19 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
Daniel Marjamäki d50e771a38 klocwork; fix uninitialized struct member. FN ticket: #10573 2021-10-28 17:09:33 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Paul Fultz II 8dc1fa7a59
Add colors to CLI reporting (#3304) 2021-07-08 21:21:35 +02:00
dummyunit 229832e72e
Read error locations in the correct order from XML (#3226)
When ErrorMessage::callStack elements are serialized to XML they are
saved in the reverse order. But when they read back from XML they are
added at the end of the list. Thus the round trip via XML reverses the
order of ErrorMessage::callStack.

From the user point of view it looks like the usage of the
--cppcheck-build-dir option sometimes (when the file wasn't reanalyzed,
but that is hard to spot) results in incorrect location info for some
diagnostic messages.

Moreover, when the first location matches some suppression rule and the
last doesn't match any (or vice versa), usage of --cppcheck-build-dir
results in some diagnostic messages appearing and disappearing seemingly
at random (again, depending on whether the file was reanalyzed or not).
2021-04-22 14:28:33 +02:00
Daniel Marjamäki 161ea81fd8 XML: Ensure file0 info is kept in multithreaded analysis. Write file0 attribute in top <error> element instead of in the <location> elements. 2021-04-05 12:03:39 +02:00
Oliver Stöneberg 6397e29f84
cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
PKEuS 141d2ac215 Refactorization: Improved internal implementation of severity and certainty levels
Backported from LCppC.
2021-02-24 22:00:06 +01:00
Oliver Stöneberg 9f9a652ae1
refs issue #9089: avoid usage of expensive std::stringstream (#2996) 2021-01-16 19:03:28 +01:00
Ken-Patrick Lehrmann 56124f0c5d
Skip calculateWarningHash if we are not in bugHunting (#3047) 2021-01-13 18:38:00 +01:00
Daniel Marjamäki bbd3a992b8 Fix output when note contains 2020-09-25 19:04:22 +02:00
Paul Fultz II 32df807b22
Fix issue 9783: wrong lifetime analysis temporary assigned to object (#2711) 2020-09-02 07:13:15 +02:00
Daniel Marjamäki aad455e1ea Fix compile error 2020-07-21 17:43:12 +02:00
Daniel Marjamäki 453cd93fae update warning hash calculation 2020-07-21 16:00:09 +02:00
Daniel Marjamäki 4ab04db53c Rename 'cppcheckID' to 'hash' 2020-07-21 11:27:03 +02:00
Daniel Marjamäki 6ab4f39f52 GUI: Suppress cppcheck-id 2020-07-15 13:03:07 +02:00
Daniel Marjamäki af0db3cc21 Add cppcheck-id for warnings. To start with it's a simple id that changes when file is changed. 2020-07-14 22:30:42 +02:00
Oliver Stöneberg 37bc0483a4
made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
Philipp Kloke 32923b7ac5 Refactorization: Fixed a couple of compiler warnings about reusing variable names 2020-05-19 08:35:12 +02:00
PKEuS 793ed68029 Refactorization: Moved code from header to source
- from utils.h to new utils.cpp
- from token.h to token.cpp
- from valueflow.h to valueflow.cpp
- from errorlogger.h to errorlogger.cpp
2020-05-19 08:35:12 +02:00
Daniel Marjamäki 08ddd84780 Update copyright year 2020-05-10 11:16:32 +02:00
Daniel Marjamäki 3e0218299b Revert "Update copyright year"
This reverts commit 6eec6c4bd5.
2020-05-10 11:13:05 +02:00
Daniel Marjamäki 6eec6c4bd5 Update copyright year 2020-05-10 11:11:34 +02:00
Daniel Marjamäki 8c57055a0b Try to make Travis happy 2020-05-03 20:46:29 +02:00
Daniel Marjamäki b5094f298a Bug hunting; Add new 'incomplete' flag for error messages. Used when analysis is incomplete. 2020-05-03 17:20:38 +02:00
Daniel Marjamäki b03bdfaf72 Import Clang ast dump (experimental) 2020-01-05 15:12:53 +01:00
Sebastian 6f2879a59b
errorlogger.cpp: Handle empty file-name like "*" (unmatchedSuppression) (#2440)
Using "--suppress=unmatchedSuppression" did not suppress the error-id in
all files, one needed to specify "*" as file-name. This commit also
allows empty file-names to suppress "unmatchedSuppression", not only "*"
or the exact file-name.
The manual uses the following example for suppressions specified in a
file:
// suppress all uninitvar errors in all files
uninitvar

This example suggests that no "*" has to be used to get suppression in
all files. I think that the command line parameter should work in the
same way.
2019-12-11 09:07:18 +01:00