309 Commits

Author SHA1 Message Date
Robert Reif
6ff5de2118 Fixed (Check for throw in __attribute__((nothrow)) function) 2014-04-20 20:40:55 +02:00
Alexander Mai
96d2666a6c Fix crash in SymbolDatabase - errorLogger may be 0 2014-04-18 21:19:49 +02:00
Alexander Mai
7d9ec01bdc - hang or --report-progress broken (does not report progress) : add reportProgress() call to SymbolDatabase 2014-04-18 20:42:22 +02:00
Daniel Marjamäki
79942df842 Fixed (false positive on std::vector - after unknown macro around the function header) 2014-04-13 13:05:30 +02:00
Daniel Marjamäki
9d51bfd015 Fixed (False positive: Same expression on both sides of '&') 2014-04-12 16:06:31 +02:00
PKEuS
9c921ab657 Fixed handling of member function pointers in setVarId and SymbolDatabase () 2014-04-12 12:04:55 +02:00
Robert Reif
7eb3988415 Fixed (False negative: mismatching allocation / deallocation whith using namespace) 2014-04-11 05:40:37 +02:00
PKEuS
2aaae741dd Fixed cppcheck message 2014-04-10 21:58:53 +02:00
PKEuS
e39b89efc3 Throw more syntaxErrors from SymbolDatabase, fixing 2014-04-10 20:11:03 +02:00
Robert Reif
847d28d283 Fixed (is there any plan to check noexcept correctness?) 2014-04-10 16:17:10 +02:00
Robert Reif
4ae204e46b Fixed (False negative: mismatching allocation / deallocation whith using namespace) 2014-04-10 16:11:11 +02:00
PKEuS
a6e134e811 Removed compatibility code for Borland and Sun compilers which should not be necessary for a compiler supporting C++11 (as required by cppcheck). 2014-04-02 17:26:59 +02:00
PKEuS
5953f02654 Refactorization: Simplifications in symboldatabase 2014-04-01 10:13:00 +02:00
PKEuS
e0574feabd Fixed problems with unknown macros for inline class methods in SymbolDatabase () 2014-03-31 21:04:01 +02:00
PKEuS
025850d961 Support unknown THROW()-style macros in symboldatabase; Fixed .
Simplified related code.
2014-03-31 20:33:01 +02:00
PKEuS
345a80f4d5 Fixed and slightly simplified symboldatabase code. 2014-03-30 11:06:44 +02:00
Alexander Mai
d1b1699bb0 Fix - Endless recursion in CheckClass::isMemberVar(). New function Type::hasCircularDependencies() is supposed to detect loops within the class hierarchy which was causing the problem 2014-03-29 12:21:35 +01:00
PKEuS
a16d631813 Further improvements to setVarId and function/array pointer detection in SymbolDatabase () 2014-03-28 17:43:40 +01:00
PKEuS
a6ca3cf2cf Throw syntaxError when encounter one in symboldatabase (fixes ) 2014-03-27 19:06:13 +01:00
PKEuS
1be7bfa7fe Fixed crash on invalid code () 2014-03-23 20:08:16 +01:00
Alexander Mai
37befc75ef In case of a loop within the class hierarchie Function::isImplicitlyVirtual_rec() was entering an endless loop. Tracking the previously analyzed types shall prevent this. 2014-03-22 08:49:28 +01:00
Thomas Jarosch
93341f4449 Use simple match where possible
Fixes these warnings found by "--enable=internal":

[lib/checkclass.cpp:972]: (warning) Found simple pattern inside Token::Match() call: "* *"
[lib/checkbufferoverrun.cpp:635]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checkbufferoverrun.cpp:1397]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/checksizeof.cpp:299]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checksizeof.cpp:301]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checksizeof.cpp:303]: (warning) Found simple pattern inside Token::Match() call: "]"
[lib/checksizeof.cpp:318]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checknullpointer.cpp:413]: (warning) Found simple pattern inside Token::Match() call: "delete"
[lib/checkio.cpp:1336]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkstl.cpp:1509]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1512]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1594]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkstl.cpp:1598]: (warning) Found simple pattern inside Token::Match() call: "] ="
[lib/checkunusedvar.cpp:755]: (warning) Found simple pattern inside Token::Match() call: "goto"
[lib/checkunusedvar.cpp:793]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkuninitvar.cpp:376]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:86]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:2181]: (warning) Found simple pattern inside Token::Match() call: "> {"
[lib/valueflow.cpp:54]: (warning) Found simple pattern inside Token::Match() call: "&"
[lib/valueflow.cpp:409]: (warning) Found simple pattern inside Token::Match() call: "do"
[lib/valueflow.cpp:425]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:487]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:511]: (warning) Found simple pattern inside Token::Match() call: "} else {"
[lib/valueflow.cpp:615]: (warning) Found simple pattern inside Token::Match() call: "for ("
[lib/symboldatabase.cpp:80]: (warning) Found simple pattern inside Token::Match() call: "= {"
[lib/symboldatabase.cpp:1069]: (warning) Found simple pattern inside Token::Match() call: "std ::"
[lib/tokenize.cpp:2207]: (warning) Found simple pattern inside Token::Match() call: "< >"
[lib/tokenize.cpp:2730]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/tokenize.cpp:4234]: (warning) Found simple pattern inside Token::Match() call: "try {"
[lib/tokenize.cpp:4235]: (warning) Found simple pattern inside Token::Match() call: "} catch ("
[lib/tokenize.cpp:5500]: (warning) Found simple pattern inside Token::Match() call: "INT8"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "}"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "do"
2014-03-14 16:27:47 +01:00
Robert Reif
8c993c1363 Partial fix for . Remember function attributes: pure, const, constructor, destructor 2014-03-14 05:40:17 +01:00
Robert Reif
d1eb04c539 Fixed (Member variable not initialized in public delegate constructor) 2014-03-12 05:48:13 +01:00
Daniel Marjamäki
ed9153ee80 Symbol database: added simple mismatch check in Scope::findFunction when passing address to function that expects a reference 2014-02-19 06:35:51 +01:00
Lauri Nurmi
70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00
Daniel Marjamäki
23efc68dd7 use nullptr 2014-02-16 10:32:10 +01:00
Daniel Marjamäki
fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Lucas Manuel Rodriguez
2048313915 Add Variable::isStlType function 2014-01-28 11:44:56 -03:00
Alexander Mai
77362fd671 Fixed (Crash: Stack overflow in isImplicitlyVirtual_rec when checking SVN) 2014-01-05 19:10:16 +01:00
Daniel Marjamäki
93a9cb40df Fixed (Internal error: match compiler returned different result than parsed match) 2014-01-04 13:53:54 +01:00
Daniel Marjamäki
32be4094e7 Symbol database: only put variables in variable list 2013-12-31 17:51:56 +01:00
Daniel Marjamäki
98b6fa2eaf SymbolDatabase: Use std::size_t for Function::getArgument() argument since Function::argCount() returns a std::size_t 2013-12-14 08:35:46 +01:00
Robert Reif
43f00942dd Fixed (SymbolDatabase: bad handling of unknown macros in function declaration) 2013-11-25 03:43:39 +01:00
Robert Reif
52df31b501 Fixed ((debug) Scope::checkVariable found variable ')') 2013-11-08 12:56:32 +01:00
Simon Martin
463ef2e71e Ticket : New test case, that works now that is fixed 2013-10-30 10:15:03 +01:00
Simon Martin
052be76635 Ticket : Avoid infinite recursion for recursive class definitions 2013-10-29 21:41:47 +01:00
Daniel Marjamäki
4a02ca8202 SymbolDatabase: handle method with unknown macro 'void f() MACRO {..}' 2013-09-28 11:44:26 +02:00
Daniel Marjamäki
4b1254bc8d Merge pull request from simartin/ticket_4994
Ticket : Don't crash when checking variable scope for invalid input
2013-09-08 06:57:42 -07:00
Simon Martin
843833f907 Ticket : Don't crash when checking variable scope for invalid input. 2013-09-07 21:16:25 +02:00
PKEuS
6b47ed414a Fixed Function::retDef initialization:
- Move/Copy Constructors and Destructors do not have a return type neither
- Fixed crash in SymbolDatabase::printOut
- Added testing
2013-09-03 10:48:01 +02:00
Robert Reif
8790f6d73f Fixed (Crash with simple code snipped in rev ab30fa3) 2013-08-31 18:58:55 +02:00
Robert Reif
fc435ae9aa CheckIO: fix false negative for a function in a base class not being found, fix false positives and negatives for std::vector operator [] 2013-08-30 05:41:59 +02:00
Robert Reif
a1b9bb0688 CheckIO: Fix false positives for functions returning unknown types and false negatives for functions returning record types 2013-08-26 06:03:26 +02:00
Robert Reif
26de3646e9 CheckIo: Revised patch that fixes bug in class function return type. Ticket: 2013-08-24 22:34:52 +02:00
Robert Reif
01fd156852 CheckIO: Start to add checking of function return types. Ticket: 2013-08-24 07:25:50 +02:00
Alexander Mai
986ec42d79 Fixed (false positive: Assert calls a function which may have desired side effects) 2013-08-22 06:38:54 +02:00
Daniel Marjamäki
b61c4b24b4 Fixed syntax error 2013-08-21 16:32:10 +02:00
Stefan Beller
e0d71de23a symboldatabase: Remove unneeded check
scope1 cannot be null at that point of time. If it were, the program
would have crashed, before (it's dereferenced ->)
This commit doesn't just remove dead code, but eliminates a tricky bug,
possibly introduced by over-optimizing compilers:
An explanation why the compiler could produce bad code here is found at
http://blog.regehr.org/archives/970

This commit was enabled by http://css.csail.mit.edu/stack/

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
2013-08-20 14:06:20 +02:00
Robert Reif
bf8a786265 reduce: add more settings from cppcheck cli 2013-08-19 06:06:53 +02:00