Daniel Marjamäki
5b6c684905
Merge pull request #747 from 3adev/apply-autopep8
...
Run all Python code through autopep8
2016-01-05 14:11:47 +01:00
Albert ARIBAUD (3ADEV)
97b43c78ce
Run all Python code through autopep8
...
Run all Python code through autopep8 as follows:
autopep8 -ri --ignore=E261,E262,E302 --max-line-length 1000 .
E261 or E262 would cause spaces after a comment's hash sign
to be squashed. Since some of the comments in cppcheck's
Python code have space-indented code examples, not ignoring
E261 or E262 would wreck the formatting of those examples.
E302 prevents autopep8 from adding some blank lines.
setting --max-line-width ensures no line will be wrapped.
2016-01-05 13:30:32 +01:00
Daniel Marjamäki
6f3ae7132e
Merge pull request #748 from 3adev/remove-tool-argparse-py
...
Remove tools/argparse.py
2016-01-05 13:18:23 +01:00
Daniel Marjamäki
125d2f7a36
Some initial support for platforms that doesn't have 8-bit char
2016-01-05 13:16:00 +01:00
Albert ARIBAUD (3ADEV)
4b247c94dd
Remove tools/argparse.py
...
As cppcheck only supports Python 2.7 and 3, and as
both provide argparse already, we can remove the
one in cppcheck.
build/*.cpp, as generated with "make SRCBUILD=build",
is strictly unchanged by this removal.
2016-01-05 10:25:12 +01:00
Matthias Krüger
b73090c351
travis: update checked clang version
2016-01-04 22:35:18 +01:00
Daniel Marjamäki
a0971355b7
Tweaked Tokenizer::simplifyAsm2()
2016-01-04 19:18:10 +01:00
Daniel Marjamäki
97dccefe3d
Merge pull request #746 from 3adev/fix-trim-in-preprocessor
...
Fix trim() in lib/Preprocessor.cpp
2016-01-04 16:58:12 +01:00
Albert ARIBAUD (3ADEV)
df91caafa1
Fix trim() in lib/Preprocessor.cpp
...
Currently, if its argument is all spaces and tabs,
trim() returns it without actually trimming it.
Fix this by returning an empty string in this case.
Also, drop a useless test: if we did not return ""
then beg is not equal to std::string::npos, and in
that case, neither is end.
2016-01-04 16:37:36 +01:00
Daniel Marjamäki
1db9cf4d09
SymbolDatabase: Add '#include <cctype>' for std::isalpha
2016-01-04 14:20:07 +01:00
Daniel Marjamäki
f1d3d5b47d
TestTokenizer::simplifyAsm2: replace invalid example code with valid code
2016-01-04 10:50:52 +01:00
Daniel Marjamäki
b748453b30
Tokenizer: Improve handling of block declarations (C extension)
2016-01-04 09:59:53 +01:00
Daniel Marjamäki
036306d7c2
Refactoring Tokenizer::startOfExecutableScope(). Improve and reuse Tokenizer::isFunctionHead().
2016-01-03 22:52:24 +01:00
Alexander Mai
d6fd4705cf
#7255 segmentation fault (invalid code) in CheckMemoryLeakInFunction::getcode
2016-01-03 20:53:03 +01:00
Daniel Marjamäki
7e585d37bc
Tokenizer: Remove startOfFunction() and use isFunctionHead() instead.
2016-01-03 19:06:11 +01:00
Matthias Krüger
d3093a6ca5
reduce: fix build
2016-01-03 17:29:40 +01:00
Daniel Marjamäki
79e663dd6f
Settings: Remove '_' prefix for public member variables
2016-01-03 16:18:17 +01:00
Daniel Marjamäki
8dccbfefcf
ValueType: handle lowercase number suffix, for instance '0ll'
2016-01-03 13:34:47 +01:00
Daniel Marjamäki
cd89e68f60
Fixed #6931 (noexcept and override qualifiers plus less than operator results in a syntax error)
2016-01-03 12:22:07 +01:00
PKEuS
be2ab9eb12
Updated TinyXML
2016-01-03 10:23:56 +01:00
Daniel Marjamäki
91d0f0fee0
astyle formatting
...
[ci skip]
2016-01-03 09:38:03 +01:00
Daniel Marjamäki
ed12b4dc44
Fixed #7253 (AST wrong on nested reinterpret_cast)
2016-01-03 09:37:38 +01:00
Daniel Marjamäki
4ff7fa3f3b
SymbolDatabase,Tokenizer: Refactor handling of noexcept
2016-01-03 08:36:00 +01:00
Daniel Marjamäki
9dabd17eae
Tokenizer::isFunctionHead(): Handling of C++ methods only in isCPP() condition.
2016-01-03 08:23:48 +01:00
Daniel Marjamäki
be8fc0f89f
SymbolDatabase: Better handling of default and delete when reusing Tokenizer::isFunctionHead()
2016-01-03 00:01:29 +01:00
Alexander Mai
b22071cb54
#7185 : Add Assertion to detect memory corruption.
2016-01-02 23:56:40 +01:00
Daniel Marjamäki
66e047ee7d
Refactoring SymbolDatabase. Reuse Tokenizer::isFunctionHead().
2016-01-02 23:49:06 +01:00
Daniel Marjamäki
0a1d10bf2f
Tokenizer: Add &|&&| to Tokenizer::isFunctionHead()
2016-01-02 23:09:44 +01:00
Alexander Mai
1d3e39df7e
Adjust message text for signConversion for constant negative epxressions
2016-01-02 22:56:15 +01:00
Daniel Marjamäki
746d024e3d
SymbolDatabase: Fix Token::Match pattern
2016-01-02 20:00:18 +01:00
Alexander Mai
ce12e1cea6
Remove unnecessaryForwardDeclaration check. It had false positives (e.g. #3663 ), was implemented in the Tokenizer and of little value.
2016-01-02 19:14:03 +01:00
Robert Reif
db6dfa2d22
Fixed #7195 (crash: valueFlowSwitchVariable())
2016-01-02 18:53:51 +01:00
Daniel Marjamäki
599327bfb1
cmdlineparser: Added -E option
2016-01-02 11:48:36 +01:00
Alexander Mai
ee5a5e8bb5
Minor modification of previous changeset (compare token with literal using str())
2016-01-01 23:37:38 +01:00
Alexander Mai
37c3d5da7b
#6731 Tokenizer::eraseDeadCode causes heap corruption on invalid code. Better detection of invalid code inside Tokenizer::simplifyFlowControl()
2016-01-01 23:32:10 +01:00
Daniel Marjamäki
ca4f55ec4c
Cleanup Copyrights. Now all should be just for Cppcheck team.
2016-01-01 23:04:16 +01:00
Daniel Marjamäki
95009a4630
Merge pull request #745 from lanurmi/2016_ad
...
Update copyright year to 2007-2016.
2016-01-01 22:57:19 +01:00
Daniel Marjamäki
416861b530
ValueType: only use default signedness for char/short/int/long/longlong
2016-01-01 20:03:31 +01:00
Daniel Marjamäki
b457ceef0e
Settings: Added defaultSign
2016-01-01 17:33:59 +01:00
Daniel Marjamäki
f5715c1496
Rename Unspecified platform type to Native
2016-01-01 16:39:41 +01:00
Daniel Marjamäki
3bd5a4d10e
CheckUnusedVar: Fix FP when there is class initialization
2016-01-01 16:04:13 +01:00
Daniel Marjamäki
2f26195b23
Fixed #7248 (crash in ValueType::str())
2016-01-01 15:13:50 +01:00
Lauri Nurmi
996c9244d8
Update copyright year to 2007-2016.
2016-01-01 15:34:45 +02:00
Daniel Marjamäki
1e0979779e
Print type information in AST dump
2016-01-01 13:54:07 +01:00
Daniel Marjamäki
dea41e2390
CheckUnusedVar: Fix FP for assignment in while
2016-01-01 12:14:18 +01:00
Daniel Marjamäki
e69e952c46
Fixed #7245 (ValueType: Wrong result type for 'sint << uint')
2015-12-31 20:18:35 +01:00
Daniel Marjamäki
98756ea7f5
Fixed #7247 (False positive CastAddressToIntegerAtReturn - returning std::string)
2015-12-31 18:53:07 +01:00
Daniel Marjamäki
350908d0e9
Fix FP in CheckUnusedVar. Caused by #7230 fix.
2015-12-31 15:30:33 +01:00
Matthias Krüger
7c1a4da6a4
testrunner: add testcase for #7246 .
2015-12-31 14:17:52 +01:00
Daniel Marjamäki
17ab0a4e9a
Fixed #7246 (crash: CheckType::checkLongCast())
2015-12-31 14:07:38 +01:00