Commit Graph

886 Commits

Author SHA1 Message Date
Daniel Marjamäki 276f017fbe
Partial fix for #11897 (Safety: show what checks are enabled/disabled) (#5372)
Example output on stdout:
```
$ ./cppcheck m1.cpp 
Checking m1.cpp ...
Active checkers: 59/177
```
2023-08-29 12:00:52 +02:00
Oliver Stöneberg a92b10ca3b
fixes #11104 (avoid C++-only parsing when processing C code in parsedecl()) / also avoid remaining `Library::detect*()` calls (#5346) 2023-08-18 22:48:24 +02:00
Oliver Stöneberg 3cf9100198
fixed #6316 (Use std::to_string() in place of MathLib::toString() ...) - deleted default implementation of `Mathlib::toString()` (#5341)
It was also used inconsistently and seemed to imply there is some
special handling which wasn't the case. It was just an alias for
`std::to_string()` for non-`double` types. So there was no need for it.

---------

Co-authored-by: Robert Reif <reif@earthlink.net>
2023-08-17 16:46:32 +02:00
Samuel Poláček 09962a6bcf
Edit verbose warning message for uninitVarError (#5301)
I think that context needs to be provided as to why it is an issue that
a variable is not initialized.
2023-08-08 15:11:39 +02:00
Oliver Stöneberg 45de338f1b
cleaned up includes based on include-what-you-use / iwyu.yml: updated to yet another distro to get the latest version and updated the Chaotic-AUR key (#5267)
This is a mess. The version is AUR is still outdated and also doesn't
install anymore. Fedora 38 carries the latest version of it so use that
now. Keep the old steps in case we need to switch again in the future.
2023-08-02 10:36:17 +02:00
Samuel Poláček e7a2585e0a
noExplicitConstructor - Verbose error message edit (#5260)
The goal is to use keywords like "converting constructor" and "implicit
conversion" that will help users further study what this warning is
about. I think that the old message provided no context to the
uninitiated.
2023-08-01 11:21:23 +02:00
Samuel Poláček c5deb0a631
Fix a typo in error message (#5264) 2023-07-26 07:54:59 +02:00
chrchr-github 258581ce2e
Fix FP uselessOverride with macro (#5238) 2023-07-13 12:18:29 +02:00
chrchr-github c0bd9f8bbd
Fix #11827 FP duplInheritedMember - different return type (#5231) 2023-07-12 15:56:07 +02:00
chrchr-github 49b79b7674
Extend duplInheritedMember check to functions (#5226) 2023-07-08 12:05:19 +02:00
chrchr-github e73183a182
Fix FP uselessOverride with shadowed member functions (#5225)
We should probably use `getDuplInheritedMemberFunctionsRecursive()` as
part of the `duplInheritedMember` check.
2023-07-07 20:17:58 +02:00
chrchr-github c738627d15
Fix uselessOverride FPs (#5223) 2023-07-07 13:18:00 +02:00
chrchr-github dde45455bf
uselessOverride: Detect code duplication in overriding function (#5219) 2023-07-05 22:58:01 +02:00
chrchr-github 6d9fa6f10a
Fix #11803 FP uselessOverride - overloaded virtual member function (#5211) 2023-06-30 15:21:08 +02:00
chrchr-github e9feeef81d
Fix FPs: uselessOverride (#5208) 2023-06-29 20:46:12 +02:00
chrchr-github a40e5817bf
Fix #11757 Detect useless overriding functions (#5155) 2023-06-29 07:43:35 +02:00
chrchr-github 9dc38f80c0
Fix #11790 FP functionConst with template function (#5187) 2023-06-25 20:38:54 +02:00
chrchr-github b26bfc9b4f
Use getAllocFuncInfo() (#5176) 2023-06-21 17:35:15 +02:00
chrchr-github bb962e2bc3
Enable and mitigate readability-else-after-return (#5175) 2023-06-20 18:43:21 +02:00
Daniel Marjamäki d75331d00d
Fix #11435 (FP ctuOneDefinitionRuleViolation for template specialization) (#5156) 2023-06-15 11:43:07 +02:00
chrchr-github 82e9c076da
Fix #11744 FN functionConst/functionStatic with recursion (#5105)
* Fix FN functionStatic

* Fix FN functionConst, add test

* Fix build
2023-06-02 23:33:42 +02:00
chrchr-github a91222fad8
Partial fix for #11637 FN functionConst (#5102)
* Partial fix for #11637 FN functionConst

* Redundant check
2023-05-31 20:55:12 +02:00
chrchr-github 7696bd1357
Fix #11225 FN constParameter with cast (#5100)
* Fix #11225 FN constParameter with cast

* Add const
2023-05-31 16:51:03 +02:00
chrchr-github cf4334904c
Fix #11626 FN functionConst with non-dereferenceable pointer access (#5074)
* Partial fix for #11626 FN functionConst with non-dereferenceable pointer access

* Fix #11626 FN functionConst with non-dereferenceable pointer access

* Fix test
2023-05-28 19:42:47 +02:00
chrchr-github 647432580f
Fix #11720 FN functionConst when using base class members (#5068)
* Fix #11720 FN functionConst when using base class members

* Format

* Add const

* Add const

* Improve const check for arguments, comments, tests

* Add test for #11573

* Add test for #11501

* Fix merge

* Add tests

* Use ASSERT_EQUALS

* Redundant check
2023-05-28 01:11:59 +02:00
chrchr-github 10b55cc0cf
Fix #11654 FN functionConst if only non-const member usage is call to itself (#5092)
* Fix #11654 FN functionConst if only non-const member usage is call to itself

* Format

* Add const
2023-05-26 17:24:13 +02:00
chrchr-github e621f721fc
Use library to get deallocation function (#5061)
* Use library to get deallocation function

* Add suppressions

* Amend

* Remove suppression

* More getDeallocFuncInfo()

* Fix suppressions

* Fix suppression
2023-05-21 14:01:14 +02:00
chrchr-github d30f8e18f7
Partial fix for #11626 FN functionConst with non-dereferenceable pointer access (#5070) 2023-05-21 14:00:24 +02:00
Daniel Marjamäki f72db74817
Fixed #11013 (FP overlappingWriteUnion with anonymous struct in union) (#5067) 2023-05-20 10:34:42 +02:00
Oliver Stöneberg 0924e6616e
made some member functions static (#4966) 2023-04-28 12:29:40 +02:00
Oliver Stöneberg f5e51eace7
do not use string-to-integer conversions without error handling (#4906) 2023-04-08 22:29:09 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes (#4885) 2023-04-08 16:08:47 +02:00
chrchr-github 8043930a0f
Fix FN uninitMemberVar with std::array (#4935) 2023-04-06 18:45:12 +02:00
chrchr-github 7503aca0e2
Fix #11621 FP functionConst when assigning init list (#4895)
* Fix #11621 FP functionConst when assigning init list

* Add comment

* Merge
2023-04-01 18:54:26 +02:00
chrchr-github 7bf6b359b1
Fix #11616 false negative: functionConst (#4887) 2023-03-27 17:54:19 +02:00
Paul Fultz II 7231d1cece
Update the isVariableChanged to correctly check the const bit (#4912) 2023-03-26 15:12:49 +02:00
chrchr-github 3d965b5b81
Fix #11618 FP functionConst with call to static function (#4898) 2023-03-20 19:29:49 +01:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr (#4897) 2023-03-17 13:51:55 +01:00
chrchr-github 9ed21fb917
Fix #11513 FN functionConst with comparison as argument (#4738) 2023-03-12 11:39:18 +01:00
chrchr-github a5b0fd38fd
Fix FP functionConst with ternary (#4874) 2023-03-09 20:07:44 +01:00
chrchr-github c76b05ad75
Fix #11607 FP constVariable with auto and std::map (#4877) 2023-03-09 20:01:50 +01:00
Oliver Stöneberg 20db3ff368
SymbolDatabase: made `mTokenizer` and `mSettings` references (#4857) 2023-03-07 12:22:06 +01:00
chrchr-github 215124461e
Fix #11499 FN functionConst with operator usage (#4722) 2023-03-02 21:51:58 +01:00
Oliver Stöneberg bd1ae69b00
cleaned up includes based on `include-what-you-use` (#4599) 2023-03-02 21:50:14 +01:00
Oliver Stöneberg 3ec4da0f8a
improved library loading in tests (#4806) 2023-03-02 21:10:51 +01:00
Oliver Stöneberg a250e6b569
enabled and mitigated `-Wunreachable-code` Clang warnings (#4818) 2023-02-24 21:57:44 +01:00
chrchr-github 8af1026696
Set functions for calls through iterators (#4763) 2023-02-07 21:57:59 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
chrchr-github b5a06d045e
Fix #11497 debug: CheckClass::isMemberVar found used member variable 'x' with varid 0 (inconclusive) (#4736) 2023-01-26 22:19:51 +01:00
chrchr-github 6e2cc450b8
Fix #11330 FN functionConst with access of smart pointer (#4720)
* Fix #11330 FNfunctionConst with access of smart pointer

* Simplify
2023-01-16 22:07:04 +01:00