Commit Graph

8717 Commits

Author SHA1 Message Date
Daniel Marjamäki d50c3de740 Remove inline suppression and fix false positive. 2019-01-13 07:59:41 +01:00
amai2012 738fef6c27 Run astyle 2019-01-12 21:51:39 +01:00
amai2012 2adf65968b posix.cfg: improve configuration for dlsym() 2019-01-12 21:50:02 +01:00
Daniel Marjamäki 022259caf3 Fix Cppcheck warning
[ci skip]
2019-01-12 19:11:18 +01:00
Daniel Marjamäki 14b419a48f Fix Cppcheck warning
[ci skip]
2019-01-12 19:10:59 +01:00
Daniel Marjamäki 21f7274533 Remove TestMemleakGlib and TestMemleakWindows
[ci skip]
2019-01-12 19:09:55 +01:00
Daniel Marjamäki 9765a2dfab Remove unused test class. The old memleaks checker will not be used anymore. 2019-01-12 18:45:42 +01:00
Daniel Marjamäki 5276fd68b2 Remove unused test functions
[ci skip]
2019-01-12 18:32:18 +01:00
Daniel Marjamäki 8dd641b8be Use OVERRIDE in test 2019-01-12 15:45:25 +01:00
Daniel Marjamäki 1cd16cf94f Suppressions: Handle comment in file that starts with # 2019-01-12 15:21:47 +01:00
Daniel Marjamäki 8b5f36670a Introduce macro OVERRIDE for gcc-4.6 compatibility. 2019-01-12 07:37:42 +01:00
juremenart 45def06d59 fix trailing / from CMAKE JSON file and update unittests to cover both (w and w/o cases) (#1592)
* fix for CMake compile_commands.json input - director does not include trailing / which makes include directories wrong - so add it if it doesnt exist

* fix the bugfix for trailing / in the directory name of CMAKE JSON file, add also new test case to see if it works in both cases (with and without trailing /)

* revert adding accidental new line
2019-01-11 16:36:55 +01:00
rikardfalkeborn 49bad106bb Add regression test for 8168 (#1588)
Ticket 8168 was fixed in 713f607168.
Add a regression test to make sure the bug doesn't reappear.
2019-01-11 14:11:48 +01:00
Paul Fultz II 921f6e4313 Fix issue 8883: False positive: returnDanglingLifetime with local struct or class (#1585) 2019-01-11 09:51:02 +01:00
Paul Fultz II 5fa956a597 Fix issue 8932: False positive knownConditionTrueFalse - valueflow ignores operator < (#1584) 2019-01-11 08:39:23 +01:00
amai2012 400c6c8e76 Improve configuration for dlopen and add suitable test 2019-01-10 21:14:37 +01:00
Daniel Marjamäki 8509159d1a Uninitialized Member variable: Fixed FP when delegate constructor is used 2019-01-10 20:13:37 +01:00
rikardfalkeborn a48c8abcda Fix 8124: False positive va_end missing with lambda (#1577)
Skip lambdas, to avoid false positives due to possible
return statements in lambdas.

Also, run dmake.
2019-01-10 18:32:17 +01:00
Paul Fultz II 4e147a4c59 Add a check for duplicate if statements
This will warn for this:

```cpp
int f(int val)
{
	int i = 0;
	if( val & 0xff)
		i = 1;
	if( val & 0xff)
		i = 1;
        return i;
}
```
2019-01-09 20:41:01 +01:00
Daniel Marjamäki 35e56942d1 Fixed #8116 ([False positive] Invalid memory leak detection when using reference.) 2019-01-09 20:38:32 +01:00
Daniel Marjamäki 75e367c48b Fixed #8340 (incorrect memleak errors) 2019-01-09 19:50:41 +01:00
amai2012 97bf5de133 Add more Windows (Microsoft) macros and a few lines of related test code 2019-01-08 21:15:04 +01:00
Daniel Marjamäki 0f9ce5edd5 Fixed #8365 (False positive on memory leak when assigned inside if statement) 2019-01-08 20:54:39 +01:00
Sebastian 0aa4910244
Boost configuration: Add macros and initial test file (#1575) 2019-01-08 20:30:21 +01:00
Daniel Marjamäki e4525d56a0 Fixed #8111 (performance warning - member variable at constructor) 2019-01-07 21:26:58 +01:00
Sebastian 7a59949cb4 qt config test: Use pkg-config to retrieve Qt settings. (#1571)
To be able to use real Qt-Code in "test/cfg/qt.cpp" and still do a
syntax check the Qt settings are read out via pkg-config now if it is
available. This way the test now can contain Qt macros and functions and
the syntax check can still be used.
Additionally the same options as for the other tests are used now for
the Qt config tests.
Installing the package "qtbase5-dev" should be enough to enable the
syntax checks (already installed for travis tests).
2019-01-07 14:40:21 +01:00
practicalswift 0a1b3a9d6f Fix typos (#1568) 2019-01-06 17:15:57 +01:00
Daniel Marjamäki 5636497c0b Fixed #8863 (false positive: (warning) Accessing an item in container 's'. Either the condition 's.empty()' is redundant or 's' can be empty.) 2019-01-06 12:21:55 +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
IOBYTE 817c748e4d Fixed #5953 (debug: varid0: Function::addArguments) (#1567) 2019-01-05 19:42:04 +01:00
Daniel Marjamäki 615903c6be Improve syntax errors for unmatched (){}[] 2019-01-05 11:56:21 +01:00
IOBYTE 32a5d66e5b Fixed #8927 (SIGSEGV below TemplateSimplifier::expandTemplate) (#1564) 2019-01-05 11:14:09 +01:00
Paul Fultz II bba6dfb8b2 Fix issue 4744: ValueFlow: known integer result
This fixes valueflow to have a value for `||` operator here:

```cpp
bool f()
{
	bool a = (4 == 3); // <-- 0
	bool b = (3 == 3); // <-- 1
	return a || b; // <-- 1
}
```
2019-01-03 07:05:31 +01:00
Daniel Marjamäki 2b63997c2c Fixed #8928 (false positive: (style) Variable 'x' is assigned a value that is never used.) 2019-01-02 20:23:02 +01:00
Daniel Marjamäki 39ceb53578 Comment out code in valueFlowArray. There was too many false positives. 2019-01-02 19:57:11 +01:00
Daniel Marjamäki 39a96a5a16 ValueFlow: Temporarily comment out valueFlowTerminatingCondition 2019-01-02 19:42:08 +01:00
Daniel Marjamäki 7a40b85531 Fixed #8906 (Encoding error in XML message: info attribute) 2019-01-02 18:22:12 +01:00
Daniel Marjamäki 236c88151f Fixed #8926 (false positive: (style) Condition 's.x<=y' is always true) 2019-01-02 18:05:55 +01:00
IOBYTE 3b9828a132 template simplifier: fix crash on daca c++-annotations project (#1556)
Fix scope info bug on derived template class which caused a use after
free crash when deleting a template forward declaration in a different
scope.
2019-01-02 07:15:45 +01:00
Daniel Marjamäki 19514331fb Fixed #8907 (unknown macro not detected) 2019-01-01 19:30:13 +01:00
Daniel Marjamäki 115be7dfc8 ValueFlow: better FwdAnalysis for complex expressions 2019-01-01 18:23:47 +01:00
Daniel Marjamäki be7afac875 ValueFlow: remove handling of == for complex expressions it did not work properly 2019-01-01 17:23:46 +01:00
rikardfalkeborn 13ffefc8b8 Valueflow: Fix right shift with more than 31 bits (#1553)
When comparing if the shift is large enough to make the result zero, use
an unsigned long long to make sure the result fits. Also, a check that
avoids setting the value if the shift is equal to or larger than the
number of bits in the operand (this is undefined behaviour). Finally,
add a check to make sure the calculated value is not too large to store.

Add test cases to cover this.

This was detected by an MSVC warning.

valueflow.cpp(1350): warning C4334: '<<' : result of 32-bit shift implicitly
                     converted to 64 bits (was 64-bit shift intended?)
2019-01-01 14:15:50 +01:00
Daniel Marjamäki a73e989d1a isConstVarExpression: Fix FPs when there is C++ cast 2019-01-01 11:34:44 +01:00
Daniel Marjamäki 04d3672bde Fixed #7203 (Better syntax error, handle array declaration with @) 2019-01-01 09:45:41 +01:00
IOBYTE c37b807613 template simplifier: also check if instantiated template is not specialized (#1551) 2018-12-31 21:29:53 +01:00
Daniel Marjamäki ac357a96f7 Fixed #7384 (confuses syntax with variable name / "variable '(' is less than zero") 2018-12-31 18:36:06 +01:00
Daniel Marjamäki 4918a18bfb ValueFlow: Value of expression after condition 2018-12-31 17:37:38 +01:00
IOBYTE 9dc8faa3b6 template simplifier: fix location of forward declaration for explicit specializations (#1550) 2018-12-31 17:19:34 +01:00
Daniel Marjamäki 141ce7cd63 ValueFlow: Use FwdAnalysisAllPaths in ValueFlow to track complex expressions 2018-12-31 17:05:46 +01:00