112 Commits

Author SHA1 Message Date
Oliver Stöneberg
63e00ea918
fixed some "Variable can be made constexpr" Rider warnings (#5615) 2023-11-03 09:55:44 +01:00
chrchr-github
c2d5aef435
Fix #12083 FN passedByValue with usage in ternary (#5575) 2023-10-31 16:12:38 +01:00
Oliver Stöneberg
06b5ef1e4d
cleaned up includes based on include-what-you-use (#5532) 2023-10-09 10:07:20 +02:00
Oliver Stöneberg
91070ca794
utils.h: added startsWith() and started using it (#5381)
This makes the code much more readable. It also makes it less prone to
errors because we do not need to specify the length of the string to
match and the returnvalue is clear.

The code with the bad returnvalue check was never executed and I added a
test to show that.
2023-09-08 19:30:25 +02:00
Oliver Stöneberg
3cbbb77335
fixed #11926 (Treat MacOS filesystem as case insensitive) / TestPath: added more tests (#5412) 2023-09-08 17:33:37 +02:00
Oliver Stöneberg
499f566e9d
got rid of duplicated file/directory existence implementations / improved errorhandling and testing of FileLister (#5350) 2023-08-23 11:22:41 +02:00
Samuel Poláček
b2511fb3ae
Check if --cppcheck-build-dir exists (#5254)
Cppcheck does not report that cppcheck build dir does not exist and also
does not report any write issues to the non-existent directory.

This means that cppcheck build dir is actually not used.

We should either create the directory or fail.
2023-08-04 17:38:43 +02:00
chrchr-github
bb962e2bc3
Enable and mitigate readability-else-after-return (#5175) 2023-06-20 18:43:21 +02:00
chrchr-github
fb850a844b
Use path to executable when trying to load library (#5082)
* Use path to executable when trying to load library

* Fix function call, add support for more OS, add test

* Format

* Handle MacOS

* Amend

* Argument as fallback

* Use Path::getCurrentExecutablePath()

* Move to cmdlineparser.cpp

* Debug output

* Use argv[0] in Cygwin

* Revert "Debug output"

This reverts commit 5a68d71f1d27549c7b4a46363f3cd5cd912018e7.

* Use native python in Cygwin
2023-05-26 06:55:36 +02:00
chrchr-github
3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr (#4897) 2023-03-17 13:51:55 +01:00
Daniel Marjamäki
e5a22e3436 Revert "improved Path handling of mixed separators (#4808)"
This reverts commit 079786775899c16e1ef96731f3ada9d42b41b544.
2023-02-24 06:21:02 +01:00
Oliver Stöneberg
0797867758
improved Path handling of mixed separators (#4808) 2023-02-23 22:34:05 +01:00
Daniel Marjamäki
464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg
7ead32f96e
various optimizations (#4535)
* avoid potentially duplicated `strTolower()` call in `Path::getFilenameExtensionInLowerCase()`

* avoid unnecessary copies

* use `unordered_*` containers for faster lookups

* symboldatabase.cpp: do not perform call in `checkReturns()` until needed

* astutils.cpp: do not perform calls in `isVariableChangedByFunctionCall()` until necessary

* tokenize.cpp: small `hasIfDef()` optimization

* use `unordered_map` for `CheckUnusedFunctions::FunctionUsage::mFunctions` / adjusted test case
2022-10-06 20:12:07 +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
Daniel Marjamäki
b387ae80f1 Fixed whole program analysis 2022-07-12 22:58:52 +02:00
Oliver Stöneberg
c9c1f83a69
use emptyString more consistently (#4034) 2022-07-10 10:57:29 +02:00
Oliver Stöneberg
b51aea5531
separated process execution code into ProcessExecutor (#4249) 2022-07-08 16:42:57 +02:00
Daniel Marjamäki
1f6554e2e8 Update copyright year 2022-05-21 12:18:27 +02:00
Oliver Stöneberg
c71033548f
fixed some clang-tidy warnings (#3080) 2022-05-08 20:42:06 +02:00
Oliver Stöneberg
8f728cb4b6
added (partial) support for specifying C++23 and support more "-std" options (#3212) 2022-04-15 16:17:36 +02:00
Alfi Maulana
aab5b39e2d
feat: add support for .ipp and .ixx extensions (#3383) 2021-08-09 10:46:56 +02:00
Daniel Marjamäki
c489626167 updated copyright year 2021-07-04 08:09:11 +02:00
Oliver Stöneberg
6397e29f84
cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
Oliver Stöneberg
eac040a00b Various clang-tidy fixes (#2192)
* use range loops

* removed redundant string initializations

* use nullptr

* use proper boolean false

* removed unnecessary continue from end of loop

* removed unnecessary c_str() usage

* use emplace_back()

* removed redundant void arguments
2019-09-25 15:25:19 +02:00
Daniel Marjamäki
41cf13bb7e Fixed #error in self check when __CPPCHECK__ is defined 2019-04-30 20:31:46 +02:00
Daniel Marjamäki
bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki
ea0232653f Fixed #8563 (CPPCheck not able to locate file through compilation database) 2019-01-05 23:11:43 +01:00
Daniel Marjamäki
45379a3aa6 Updated copyright year for modified files
[ci skip]
2018-06-10 22:07:21 +02:00
Daniel Marjamäki
b459da2ac3 Refactor Path::getRelativePath() 2018-04-18 22:23:38 +02:00
Daniel Marjamäki
c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
amai2012
e4cdb51f7f #8240 Fix test error due to path handling 2017-10-11 08:45:29 +02:00
Daniel Marjamäki
b1c730405f Code cleanup 2017-10-06 22:45:37 +02:00
hexcoder
051a18b120 pull request for ticket 8180 (better diagnostic output for bailouts) (#964)
* sync build instructions from readme.txt

* refactored the patch from ticket 8180. Moved logic from macros to the bailoutInternal function

* adapt to new bailout message format

* adapt to new bailout message format

* adapt to new bailout message format

* compile fix for Microsoft platform

* remove directory part from file locations in bailout message (normalize)

* remove directory part from valueflow message filter

* adapt tests to file format without directory part

* adapt tests to file format without directory part

* new line number agnostic assert_equals methods

* new line number agnostic assert_equals methods

* adapt to new method assertEqualsWithoutLineNumbers()

* adapt to new method assertEqualsWithoutLineNumbers()

* Bugfix: do not replace line number with spaces, remove it

* review changes: const char * -> std::string, size_t -> int, std::to_string() -> MathLib::toString()

* set #line at the beginning to guard against insertions from match compiler

* Bugfix: counting lines can be difficult :-) #line 1 -> #line 2

* added method stripDirectoryPart()

* added method stripDirectoryPart()

* used new method Path::stripDirectoryPart()

* new dependency path.h in lib/valueFlow.cpp

* code cleanup, removing redundant temporary objects and casts
2017-10-05 23:03:13 +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
885f8452e4 reuse case insensitive string comparison function 2017-09-30 11:25:46 +02:00
Ayaz Salikhov
b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +02:00
Daniel Marjamäki
267a2e154d Fixed #8127 (cppcheck 1.80 compilation by MINGW32 gcc 6.3 failed) 2017-07-31 18:30:20 +02:00
neheb
ef86ac04b4 Add OpenCL support
OpenCL is basically C99.
2017-06-22 17:34:07 -07:00
Daniel Marjamäki
1e12ec241c reuse simplecpp::simplifyPath 2017-06-21 14:27:46 +02:00
Daniel Marjamäki
ccb2f2ce6a astyle formatting
[ci skip]
2017-06-03 15:30:36 +02:00
Daniel Marjamäki
bbde3cc23a Merge pull request #910 from mathbunnyru/asalikhov/improve_readability
improve readability
2017-06-03 14:33:21 +02:00
uburuntu
f4ce49d883 ENH: perfomance: using clear() and empty() more faster for stl containers 2017-06-02 22:38:00 +04:00
Ayaz Salikhov
f5646183cd Move comment to the right place 2017-06-02 17:15:24 +03:00
Ayaz Salikhov
132c0af22a Simplify some statements 2017-06-01 02:02:12 +03:00
Ayaz Salikhov
3cd2f2d092 Don't cast bool to bool 2017-06-01 01:49:40 +03:00
Ayaz Salikhov
cb58cf8163 .length() > 0 == !.emepty() 2017-06-01 01:42:29 +03:00
amai
624ceb5027 Fix includes for cygwin 2017-05-27 10:23:06 +02:00
Ayaz Salikhov
28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
orbitcowboy
b9bac79a8c Improved const correctness, there are no functional changes. 2017-05-12 16:20:47 +02:00