Commit Graph

70 Commits

Author SHA1 Message Date
Oliver Stöneberg f2461781fd
added `xml.h` wrapper for TinyXML2 / cleaned up suppressions of Clang compiler warnings (#5700) 2023-11-26 14:04:35 +01:00
Oliver Stöneberg 989d276dde
removed the need for `Check` object in `CTU::getUnsafeUsage()` callback / some CheckUninitVar cleanups (#5610)
The `Check` objects were just created for that purpose so they basically
just were wrappers for the pointers passed into them and were
unnecessary.
2023-11-03 18:27:11 +01:00
Oliver Stöneberg 63e00ea918
fixed some "Variable can be made constexpr" Rider warnings (#5615) 2023-11-03 09:55:44 +01: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
chrchr-github eee1221738
Use in-class initializers, default constructors, class -> struct (#4842) 2023-08-08 11:05:02 +02:00
Daniel Marjamäki a4d2178f3c Fix ctuuninitvar false positive for struct that is partly initialized 2023-03-13 20:55:11 +01:00
Oliver Stöneberg 5af6ca6637
made `Platform` a member of `Settings` instead of inheriting from it / cleanups (#4791) 2023-03-03 18:36:27 +01:00
chrchr-github 51c5a79150
Fix #11586 FP ctuArrayIndex with unknown typedef (#4831) 2023-03-02 21:19:53 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
chrchr-github 68acd77053
Fix #11361 FP ctuPointerArith with unknown buffer size (#4591) 2022-11-23 19:11:47 +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
chrchr-github 7156afe003
Fix #5140 FN (error) buffer access out of bounds - known argument (#4402)
* Fix #5140 FN (error) buffer access out of bounds - known argument const char* argv[]

* Format
2022-08-26 17:27:54 +02:00
Oliver Stöneberg 16f598c409
added missing `sstream` includes (#4381) 2022-08-19 10:16:23 +02:00
chrchr-github 6eab3cb8bd
Fix #9788 ctu: false negative array index out of bounds for array arguments (#4277) 2022-07-13 21:08:51 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` (#4249) 2022-07-08 16:42:57 +02: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 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
chrchr-github 9c56e7ea8d
Fix #6475 FN uninitialized variable usage not detected (#3700) 2022-01-17 20:35:30 +01:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Daniel Marjamäki b729c4a126 ctu: fixes for xml output 2021-08-06 07:57:18 +02:00
Daniel Marjamäki ad478914f7 cppcheck build dir; Fix several xml syntax errors in the analyzer info files 2021-08-04 21:39:24 +02:00
Daniel Marjamäki e03ef93ed7 Fix compiler error 2021-05-01 18:57:10 +02:00
Daniel Marjamäki e78612d280 Refactoring; Use TinyXml methods to parse bool/int attribute values 2021-05-01 18:40:20 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Oliver Stöneberg ac7647fcd8
some self-check suppression cleanups (#3032) 2021-01-09 20:32:38 +01:00
Oliver Stöneberg d59abfd977
fixed clang-tidy warnings (#3006)
* clang_tidy.cmake: added clang-tidy-11 to list of executables to look for

* .clang-tidy: disabled warnings we are (currently) not interested in

* fixed clang-tidy warnings
2021-01-02 23:10:27 +01:00
Rikard Falkeborn d19454b935
Refactoring: Convert ValueType to enum class (#3005) 2021-01-02 09:30:00 +01:00
Daniel Marjamäki 25ad22c6af astyle formatting
[ci skip]
2020-07-23 10:09:06 +02:00
Paul e2a81a382f Track reading aliases during valueflow forward 2020-07-19 23:25:35 -05:00
Oliver Stöneberg 37bc0483a4
made check.h less heavy (#2633) 2020-05-23 07:16:49 +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
Oliver Stöneberg 1af959af2c
fixed -Wextra-semi-stmt Clang warnings (#2553)
* fixed -Wextra-semi-stmt Clang warnings

* adjusted REDIRECT macro to require a semicolon

* testmathlib.cpp: rolled back accidental change
2020-04-21 17:27:51 +02:00
Oliver Stöneberg 2c1e36e63e
cleaned up includes based on include-what-you-use (#2600)
* cleaned up includes based on include-what-you-use

* check.h: trying to work around Visual Studio 2012 bug

* fixed Visual Studio compilation
2020-04-13 13:44:48 +02:00
Paul Fultz II ad8abdb0c3 Add impossible values to ValueFlow (#2186)
* Add impossible category

* Replace values

* Try to adjust known values

* Add ! for impossible values

* Add impossible with possible values

* Remove contradictions

* Add values when the branch is not dead

* Only copy possible values

* Dont bail on while loops

* Load std lib in valueflow

* Check for function calls

* Fix stl errors

* Fix incorrect impossible check

* Fix heap-after-use error

* Remove impossible values when they are lowered

* Show the bound and remove overlaps

* Infer conditions

* Dont push pointer values through dynamic_cast

* Add test for dynamic_cast issue

* Add shifttoomanybits test

* Add test for div by zero

* Add a test for issue 9315

* Dont make impossible value inconclusive

* Fix FP with shift operator

* Improve handleKnownValuesInLoop for impossible values

* Fix cppcheck warning

* Fix impossible values for ctu

* Bailout for streams

* Check equality conditions

* Fix overflows

* Add regression test for 9332

* Remove duplicate conditions

* Skip impossible values for invalid value

* Check for null

* Rename bound to range

* Formatting
2019-09-20 15:06:37 +02:00
Daniel Marjamäki fc25fe83bd ctu: fixed error locations 2019-09-12 19:20:13 +02:00
Daniel Marjamäki b8e3d3b982 CTU: Add 'column' 2019-09-12 10:46:33 +02:00
Daniel Marjamäki 2d9a131817 Refactoring: Rename variables. Do not use leading _. Renamed 'col' to 'column' 2019-08-18 12:19:05 +02:00
Daniel Marjamäki 0014fe880e Mark members and arguments with 'nonneg' 2019-07-14 12:22:33 +02:00
Daniel Marjamäki 49dd2deef1 Avoid 'unsigned' in ctu 2019-07-13 20:31:50 +02:00
Daniel Marjamäki 95d65c8c34 Refactoring; enum class 2019-07-10 14:05:16 +02:00
Scott Furry a195477470 Correct Zero/Null as pointer constant (#1938)
Building with enhanced clang warnings indicated a large number of
instances with the warning:

`warning: zero as null pointer constant`

Recommended practice in C++11 is to use `nullptr` as value for
a NULL or empty pointer value. All instances where this warning
was encountered were corrected in this commit.

Where warning was encountered in dependency code (i.e. external library)
no chnages were made. Patching will be offered upstream.
2019-06-30 21:39:22 +02:00
Daniel Marjamäki 61a259597b Fix Cppcheck warnings 2019-06-15 13:28:01 +02:00
Daniel Marjamäki a7478bcb5a Add missing include 2019-05-09 06:55:36 +02:00
Daniel Marjamäki 66b2b31eb0 Fix a few useStlAlgorithm warnings 2019-05-08 20:23:32 +02:00
Daniel Marjamäki d6b806c592 CheckBufferOverrun: Better CTU checking when variable address is passed 2019-03-23 15:57:17 +01:00