Commit Graph

20771 Commits

Author SHA1 Message Date
Daniel Marjamäki ed5ae7c5fa SymbolDatabase::findFunction: Use ValueType::matchParameter for float literal parameters 2019-07-29 21:53:39 +02:00
Daniel Marjamäki cccbfaa0e4 SymbolDatabase::findFunction: Use getArguments utility function 2019-07-29 21:17:31 +02:00
amai2012 24ad434c52 Refactoring: use enum class 2019-07-29 21:05:09 +02:00
Daniel Marjamäki 3ad9d6a1ad Make the code a bit more robust 2019-07-29 20:57:16 +02:00
orbitcowboy ba97e3844f wxwidgets.cfg: Added support for more interfaces. 2019-07-29 19:24:15 +02:00
Daniel Marjamäki f63011c219 Try to fix daca@home crashes 2019-07-29 19:06:41 +02:00
Sebastian 4e6a228b97
qt.cfg: Add obsolete functions qStableSort() and qSwap() (#2050) 2019-07-29 18:58:31 +02:00
Sebastian 2a3567cb44
std.cfg: Add std::string::copy() and std::wstring::copy() (#2041)
Reference:
https://en.cppreference.com/w/cpp/string/basic_string/copy
http://www.cplusplus.com/reference/string/string/copy/
2019-07-29 18:57:50 +02:00
Daniel Marjamäki 9e738db435 SymbolDatabase: expand usage of ValueType::matchParameter for non-pointer variables 2019-07-29 18:46:50 +02:00
Daniel Marjamäki 3066c0653c Fixed #8668 (SymbolDatabase: Wrong findFunction match for const pointer argument) 2019-07-29 18:14:23 +02:00
Sebastian cce061fe95
qt.cfg: Add functions of class QDomElement (#2049)
Most were found by daca@home
2019-07-29 16:57:16 +02:00
Daniel Marjamäki 607b3daca8 ValueFlow: Improve bailout for structs etc in loops 2019-07-29 15:51:48 +02:00
Daniel Marjamäki 6b662c7353 Fixed #8777 (GUI: Wrong platform used and shown in "Analysis Log") 2019-07-29 11:22:57 +02:00
Daniel Marjamäki a1214348c0 Fixed #8974 (false negative regression about never used variable) 2019-07-29 08:49:19 +02:00
Daniel Marjamäki 602911cfca Activate a TODO test case 2019-07-29 08:06:57 +02:00
Daniel Marjamäki a178d05cc5 Changed TODO test case, I do not see why it should warn. 2019-07-29 07:51:00 +02:00
IOBYTE 07ac6c5f08 Fix ternary operator simplification to accept template parameters. (#2048)
Also simplify decltype of bool and numeric literals in template
arguments.
2019-07-28 21:52:52 +02:00
IOBYTE badc573b80 Fix #9224 (Performance regression in template parsing: 250x - 1200x slower) (#2046) 2019-07-28 09:25:18 +02:00
ChristophStrehle f7f60a8da6 Variable number of arguments for boost test suite macros (#2043)
The macros defined in unit_test_suite.hpp have a variable
number of arguments if BOOST_PP_VARIADICS is defined.

See:
https://github.com/boostorg/test/blob/develop/include/boost/test/unit_test_suite.hpp
2019-07-28 09:23:27 +02:00
Daniel Marjamäki e60c4e4768 Travis: Remove step that analyse llvm source code 2019-07-28 08:58:06 +02:00
Georgy Komarov e88e024509 Addons: Add README (#2047)
* Addons: Add README

* fix
2019-07-28 07:51:03 +02:00
Daniel Marjamäki e8ec6e6f11 Fixed #8349 (Noisy nullPointerRedundantCheck) 2019-07-27 20:03:06 +02:00
Rikard Falkeborn 0324bbf63c dmake: Fix check of last header file in lib.pri (#2045)
Since the number of test files is larger than the number of lib files,
this only caused an extra harmless '\' being printed after the last
header file in lib.pri. If the number of test files would have been
smaller than the number of lib files, the generated lib.pri would have
been broken.
2019-07-27 09:45:04 +02:00
Daniel Marjamäki 1c75257212 Token::hasKnownIntValue: Fix when there is one possible int value and one known BUFFER_SIZE value, it should return false. 2019-07-27 08:25:07 +02:00
versat 22f8080d1d qt.cfg: Add some functions of class QLabel 2019-07-26 15:59:47 +02:00
Georgy Komarov fe2885e430 cert.py: Refactor arguments handling (#2044)
* cert.py: Add '--quiet' option and test

Main sentinel also was required.

* travis.yml: Install pytest with --user

To avoid possible conflicts with system packages later.

* Quickfix
2019-07-26 15:40:25 +02:00
versat cdb0e8322c qt.cfg: Add qSort() and some functions of class QAction 2019-07-26 14:56:32 +02:00
Sebastian ee72bb7107
donate-cpu.py: Improve detection of Qt library usage (#2042) 2019-07-26 13:50:04 +02:00
Sebastian 6d1ce99dce
donate-cpu.py: Do not report crash if no source file has been found. (#2028)
Sometimes there are no relevant source files (.c, .cpp, ...) extracted,
but other files are (.h, ...).
There could be only header files for example. Then Cppcheck returns with
exit code 1 and prints an error message. This is no crash and now no
longer reported as such.
2019-07-26 10:15:09 +02:00
versat 1f71fe15d6 opengl.cfg: Add functions glGetString() and glGetStringi() 2019-07-26 09:04:01 +02:00
Sebastian dcc2599121
std.cfg: Add `<pure/>` to std::min() and std::max() (#2037) 2019-07-26 07:51:26 +02:00
Rikard Falkeborn f95d193e22 Fix #8282 (memleak FP when returning std::pair) (#2039) 2019-07-26 07:03:58 +02:00
Paul Fultz II ee28a45db4 Fix issue 9235: new crash in astutils isVariableChanged from endless recursion (#2040) 2019-07-26 07:03:21 +02:00
Paul Fultz II b049fd9303 Improve propogation of lifetimes of function arguments
This will now warn for cases like this:

```cpp
int* f(int * x) {
    return x;
}
int * g(int x) {
    return f(&x);
}
````
2019-07-26 07:02:07 +02:00
Georgy Komarov fbd7b5180b Update addons structure. Make Y2038 addon works. (#2024)
* Update addons structure. Make Y2038 addon works.

All addons are now located in same directory, where cppcheck-gui is
looking for them.

Y2038 addon has been updated to latest cppcheck version. Output is same
as 303622f01c commit as it described in
README: 303622f01c/addons/y2038/README.

* Clean up .travis.yml

* Update travis.yml paths.

* misra.py: Bring back -P argument for backward compatibility

* Fix paths

* Normalize dumpfile paths tpo cppcheck format

* Fixup 3 test.

* Add arguments regression test.

* Fixing travis build
2019-07-26 06:38:03 +02:00
Daniel Marjamäki 3458692cc7 Travis: Remove Precise job because they are decommisioning that environment :-( 2019-07-25 22:30:44 +02:00
Rikard Falkeborn a69a570505 Fix FP leakVarNotUsed with freopen() and stdin (#2034)
One usecase for freopen() is to redirect input and output streams to
files. For that, the return value is not needed.
2019-07-25 21:09:23 +02:00
Daniel Marjamäki 9009eeb83d Tweak Function::isSafe() 2019-07-25 20:52:24 +02:00
Daniel Marjamäki 4611cbb5bb One more fix for Function::isSafe 2019-07-25 17:31:52 +02:00
Daniel Marjamäki 09be07f2b2 Fix Function::isSafe 2019-07-25 17:28:32 +02:00
Daniel Marjamäki 45d1ca6f7c Safe checks: Clarify a warning message 2019-07-25 17:19:51 +02:00
Sebastian 2d5f3ae3b4
std.cfg: Add std::next() and std::prev() (#2022)
Reference:
https://en.cppreference.com/w/cpp/iterator/next
https://en.cppreference.com/w/cpp/iterator/prev
2019-07-25 12:40:15 +02:00
orbitcowboy b3e9724c06 wxwidgets.cfg: Added support for more interfaces. 2019-07-25 10:07:17 +02:00
orbitcowboy 9ea75bc7fe wxwidgets.cfg: missing const-flag 2019-07-25 09:47:27 +02:00
orbitcowboy 46072f7ed5 windows.cfg: Added support for FindResource(). 2019-07-25 09:46:40 +02:00
orbitcowboy 8ca54d9d2b wxwidgets.cfg: Added support for wxPGProperty::GetCellRenderer(). 2019-07-25 09:46:10 +02:00
Scott Furry 88e2e82039 Correct Signal/Slot signatures (#2035)
Previous commit had updated declarations in Code Editor Style Dialog to use
const QColor& and const QFont::Weight& variables. This change was not totally
complete as const usage was not propagated to Signal/Slot connect statements.

This commit corrects that oversight.
2019-07-25 08:29:42 +02:00
Sebastian 8f92c43567
.travis.yml: Check more Python scripts with pylint (#2019)
Use renamed pylintrc file that is only meant for Travis checks.

Check all Python scripts in 'addons', 'htmlreport' and 'tools'

Errors for `_socketobject` class are disabled, see
https://stackoverflow.com/questions/10300082/how-to-prevent-python-pylint-complaining-about-socket-class-sendall-method

Install imported modules `unittest2` and `pexpect` via pip.

Add "./addons" to search-path for modules because
"tools/compare-ast-clang-and-cppcheck.py" imports cppcheckdata.py from
addons. Pylint does not seem to evaluate
`sys.path.insert(0, '../addons')` in the script. So an `init-hook` is
necessary in pylintrc_travis.
2019-07-24 21:09:53 +02:00
Paul Fultz II 744a94ad5a Fix issue 9231: FP constParameter - argument passed parent ctor (#2032) 2019-07-24 20:59:58 +02:00
IOBYTE 999d2f797c Fix #9225 (Crash on valid C++14 code) (#2031)
* Fix #9225 (Crash on valid C++14 code)

This only fixes the crash. Specialization of nested templates is still
broken.

* fix cppcheck warnings

* fixed another cppcheck warning
2019-07-24 19:20:19 +02:00