6653 Commits

Author SHA1 Message Date
Daniel Marjamäki
a95e5bff2b Fixed #6344 (false positive: out of bounds access when array size is unknown) 2014-12-20 18:50:08 +01:00
Daniel Marjamäki
f24e1b82cf astyle formatting 2014-12-20 18:47:40 +01:00
Daniel Marjamäki
b8371ebd87 Revert 2e45df3b. Because there are FP. 2014-12-18 06:37:15 +01:00
Matthias Krüger
cc7f69da54 fix two internal warnings:
[lib/checkuninitvar.cpp:1668]: (style) Call to 'Token::tokAt()' followed by 'Token::str()' can be simplified.
[lib/checkuninitvar.cpp:1669]: (style) Call to 'Token::tokAt()' followed by 'Token::str()' can be simplified.
2014-12-17 19:06:13 +01:00
orbitcowboy
2e45df3b72 Fixed #6341: false negative uninitvar pattern "return foo ( %var%" 2014-12-17 17:43:31 +01:00
Daniel Marjamäki
a1537e1a6e Fixed #6339 (false negative: array index out of bounds on allocated buffer using valueflow) 2014-12-17 16:23:48 +01:00
Simon Martin
4c7a8c5497 Ticket #6181: Properly handle >> terminating template parameter lists. 2014-12-14 15:14:27 +01:00
PKEuS
010eb1c8cb Merge pull request #483 from simartin/ticket_6172
Ticket #6172: Properly grok %type%... template parameters.
2014-12-14 17:01:25 +01:00
Simon Martin
859c6381cc Ticket #6172: Properly grok %type%... template parameters. 2014-12-14 14:33:37 +01:00
Daniel Marjamäki
5490fad8c7 Fixed #5840 (False positive (inconclusive): Possible nullpointer dereference - use before for-loop over nested list) 2014-12-14 14:10:42 +01:00
Thomas Jarosch
2f1ba89567 Improve readability of Library::load()
by caching often used node names.

Also constify existing name caches.
2014-12-12 22:18:22 +01:00
PKEuS
ff5ede342b Fixed #6266: Support noexcept(false) 2014-12-09 23:53:50 +01:00
PKEuS
4d81945ac5 Fixed a couple of #6276 integer over/underflow issues 2014-12-09 23:28:22 +01:00
PKEuS
493ab541ab Fixed #6291 and #6293: Support :: in front of function name in checkUnusedFunctions
Simplified code in CheckUnusedFunctions
2014-12-09 22:04:51 +01:00
PKEuS
e9bc3b7acf Fixed #6308: Properly associate Function with Scope for destructors in SymbolDatabase 2014-12-09 21:36:09 +01:00
Alexander Mai
cef324435f Remove dead code in CheckMemoryLeakInFunction::call_func() (Coverity CID 1257017) 2014-12-09 20:34:30 +01:00
Dmitry-Me
ff6604e289 Make expensive string manipulation depend on settings 2014-12-09 06:08:38 +01:00
Alexander Mai
ec2c4aa2e3 #6301 Unused shared lock variable. Add exception for std::shared_lock() to CheckUnusedVar::checkFunctionVariableUsage_iterateScopes() 2014-12-07 15:32:09 +01:00
Daniel Marjamäki
64e6b5186d astyle formatting 2014-12-05 06:41:47 +01:00
Alexander Mai
c2584aa635 #6303 crash in CheckBufferOverrun. Add check on loop variable in CheckBufferOverrun::checkScope(). 2014-12-04 20:49:58 +01:00
Matthias Krüger
7a6cd54059 Fix [lib/tokenize.cpp:6184]: (warning) Found simple pattern inside Token::Match() call: ") {" 2014-12-04 11:11:47 +01:00
Daniel Marjamäki
e3892a95b5 Fixed #6290 (Tokenizer: Because 'and' is not simplified to '&&' there are false positives) 2014-12-03 16:32:05 +01:00
Dmitry-Me
7d259c073a Cache and reuse value 2014-12-02 16:19:52 +03:00
Daniel Marjamäki
0b9d80c95d Refactoring CheckUnusedFunctions so it uses new infrastructure for multifile analysis 2014-12-02 06:41:18 +01:00
Dmitry-Me
cf3f8c2f38 Refactoring: Replace names with underscores with camelCase names 2014-12-01 16:22:56 +01:00
Dmitry-Me
c0d2933ec7 Reorder checks to avoid redundant actions 2014-11-30 16:14:53 +03:00
Dmitry-Me
6482fefe3e Cache and reuse previously computed value 2014-11-30 13:00:27 +01:00
Dmitry-Me
5e37275b2a Code cleanup. Use 'isDelete' instead of token match 2014-11-28 17:50:23 +01:00
Dmitry-Me
828fdb6c47 Code cleanup. Omit redundant check. 2014-11-28 17:48:23 +01:00
Robert Reif
418c2e51a0 Fixed #3314 (cppcheck incorrectly reporting Syntax error.) 2014-11-28 17:44:36 +01:00
Robert Reif
0dad8b64e8 Fixed #6268 (False positive functionStatic (inconclusive) - nested namespaces) 2014-11-27 06:29:33 +01:00
Daniel Marjamäki
139414bd5c astyle formatting 2014-11-26 16:13:57 +01:00
Daniel Marjamäki
465555e39d Fixed memory leaks for non-solaris compilers. 2014-11-26 16:13:40 +01:00
amai2012
0913a51ccd Merge pull request #469 from lasergnu/SEGV
Fix SEGV on Solaris x86
2014-11-25 17:01:00 +01:00
Dmitry-Me
f926958acb Fix false positive about return type when there's =delete in operator= declaration 2014-11-25 15:52:52 +01:00
Jay Sigbrandt
f7eeb82ca4 Fix SEGV on Solaris x86
On Solaris x86, with both GCC 4.8 and 4.9, running cppcheck causes a segmentation fault when process terminates.

The backtrace (dbx) where
=>[1] _ZNSt14_List_iteratorIP5CheckEppEv(0x804798c, 0x8047994, 0xc0d61d6, 0x291a), at 0x8291b7c
  [2] std::list<Check*, std::allocator, <Check*>void>::remove(0x84ab328, 0x80479c8, 0x80479d4, 0x82d96fc), at 0x82da984
  [3] Check::~Check(0x84a9fc4, 0x83d232c, 0xfef411fb, 0x83d135c), at 0x82d9709
  [4] CheckExceptionSafety::~CheckExceptionSafety(0x84a9fc4, 0xfee82a40, 0xfee82a40, 0xfedcf000), at 0x8311e7d
  [5] __static_initialization_and_destruction_0(0x0, 0xffff, 0xfedd4c80, 0xfedcf000), at 0x81b01f8
  [6] _GLOBAL__sub_D__ZN20CheckExceptionSafety11destructorsEv(0x83d135c, 0xfedd4f18, 0x8047a50, 0x828a5f5, 0xfedcf000, 0x8047a68), at 0x81b023c
  [7] __do_global_dtors_aux(0xfedcf000, 0x8047a68, 0xfece28cd, 0x8047b08, 0x8047a48, 0xfedcf000), at 0x8185b90
  [8] _fini(0x8047b08, 0x8047a48, 0xfedcf000, 0xfedd4f00, 0x8047a80, 0xfecd4e72), at 0x828a5f5
  [9] _exithandle(0xfeffb7d8, 0x8185a1a, 0x0, 0x0, 0x0, 0x0), at 0xfece28cd
  [10] exit(0x1, 0x8047b70, 0x0, 0x8047ba3, 0x8047bba, 0x8047ce6), at 0xfecd4e72

The destructor order is somehow getting messed up on this platform.

This fix moves the code away from header file and ensures _instances remains valid during termination.
2014-11-25 14:03:46 +01:00
Daniel Marjamäki
a002654c47 Reverted refactoring 828417c for now. It caused a major slowdown in the unused functions checking. 2014-11-24 06:37:08 +01:00
Dmitry-Me
298021af1f Remove redundant variable and manipulation thereof 2014-11-22 12:17:49 +01:00
Frank Zingsheim
9497732ac8 Fixed #6238 (false positive with double fopen) 2014-11-20 22:19:39 +01:00
Alexander Mai
d4e59065df Fix some (clang) compiler warnings 2014-11-20 20:49:05 +01:00
Daniel Marjamäki
051d42ae6b astyle formatting 2014-11-20 14:20:09 +01:00
orbitcowboy
4a2a4474c9 Fixed #6281: MathLib: Long integer suffix i64 is not supported. 2014-11-20 10:23:09 +01:00
orbitcowboy
f5d804f71a running astyle 2014-11-20 10:13:03 +01:00
Robert Reif
d12f14844a Fixed #6279 (False Positive: Member variable 'Fred::i' is not initialized in the constructor) 2014-11-20 06:18:29 +01:00
Robert Reif
b7c9187539 Fixed #6280 (MathLib: binary literals are integers) 2014-11-19 06:43:52 +01:00
PKEuS
4163f1e122 Fixed #6260 - C++11 style array initialization 2014-11-18 19:50:09 +01:00
PKEuS
428587f3d4 Fixed #6275: Simplification of = (NULL); to = 0; 2014-11-18 19:39:38 +01:00
Alexander Mai
85c02df56c Fix compiler warning. run astyle 2014-11-18 19:36:47 +01:00
PKEuS
ad8749c0bd Fixed #6278: Remove casts to references to pointers in Tokenizer::simplifyCasts() 2014-11-18 19:23:59 +01:00
Dmitry-Me
34bd612ea9 Omit unneeded operations 2014-11-18 16:35:36 +03:00