21490 Commits

Author SHA1 Message Date
Sebastian
83caedec8a
donate-cpu.py: Fix two pylint warnings (#2327)
Line 102: Comparison to literal
Line 117: Unnecessary "else" after "break"
2019-11-04 18:36:14 +01:00
Daniel Marjamäki
06ea1a2b53 Fixed #9312 (FP : variable is assigned a value that is never used (static)) 2019-11-04 17:59:16 +01:00
Sebastian
61286392d9 htmlreport: Also check "cppcheck-htmlreport" with pylint on Travis (#2326)
The error that pylint does not find HtmlFormatter in pygments.formatters
is known and the common solution is to suppress this error.
See https://github.com/PyCQA/pylint/issues/491
2019-11-04 15:44:13 +01:00
Maksim Derbasov
afe59531c7 Triage cleanup (#2324)
* regex for version

* fields names improved

* codestyle

* m prefix for fsmodel

* string duplication removed

* find in files: show all entries

* spaces

* added hint to checkboxes; element naming fixed

* layout naming improvement

* spacing 6->1
2019-11-04 07:10:31 +01:00
Paul Fultz II
acd2a92efc Fix issue 9395 and 9423: False positive: nullPointerRedundantCheck (#2323) 2019-11-04 07:02:25 +01:00
Georgy Komarov
c207828a11 misra.py: Fix large memory usage with suppressions (#2321)
* misra.py: Fix large memory usage with suppressions

Don't save whole lxml locations when collecting rules suppressions
statistics. This fixes the problem with large memory usage when
some rules are suppressed.

See issue description:
https://sourceforge.net/p/cppcheck/discussion/development/thread/51fc053626/

* don't override 'file' builtin
2019-11-04 06:58:33 +01:00
Georgy Komarov
ff61d8e370 misra.py: Skip execution for globally suppressed checks (#2301)
These changes will improve misra.py execution time in the
case where we use globally suppressed checks. For example, when using
single MISRA rule and suppress others, we could get about twice the
execution speed, since most of `MisraChecker' class methods will not
be started at all.

Some measurements and discussion are available at:
https://github.com/danmar/cppcheck/pull/2301
2019-11-04 06:57:41 +01:00
Paul Fultz II
c38bbb75e4 Fix issue 9448: Check for temporaries from library function calls (#2312) 2019-11-03 22:02:10 +01:00
Daniel Marjamäki
c7a23f126f Fixed #9373 (False Positive - missingOverride) 2019-11-03 18:42:04 +01:00
Daniel Marjamäki
c3ae028a41 Fixed #8617 (False positive: uninitdata for memory allocated and initialized in function called new (C code)) 2019-11-03 17:08:28 +01:00
Daniel Marjamäki
8c8952ae7c Fixed #9324 (FP compareBoolExpressionWithInt - when using C++ and/or operator synonyms) 2019-11-03 12:53:30 +01:00
Daniel Marjamäki
03ae0ccef3 AST: Do not hang for code 'foo({ for (a;b;c) {} });' 2019-11-03 11:02:59 +01:00
Daniel Marjamäki
fadf209e18 Add test for #9326 (FP knownConditionTrueFalse - Returning bool variable treated as condition) 2019-11-03 08:49:39 +01:00
Daniel Marjamäki
df8bdabddd Testing; Readded tests 2019-11-03 08:45:34 +01:00
Maksim Derbasov
7de55b09f8 Triage tool ui improvement (#2320)
* triage tool: ui improvement

* small code tweak

* ci fix

* ci fix 2nd attempt
2019-11-03 08:30:30 +01:00
Armin Müller
c95b5d0a3c donate-cpu-server.py: Add explanation how to read timing list (#2315)
* Add explanation how to read timing list

* fixed HTML
2019-11-03 08:27:05 +01:00
Daniel Marjamäki
908cd39572 daca2-packages: improved filter for versions 2019-11-03 08:13:06 +01:00
Daniel Marjamäki
dbbea54b74 daca2-getpackages: if a package has many versions then only scan latest 2019-11-03 08:05:06 +01:00
Daniel Marjamäki
9917ff1ce1 googletest: ASSERT_THROW / EXPECT_THROW 2019-11-02 20:17:04 +01:00
Daniel Marjamäki
791242ea78 Fixed #6975 and #9376 (Tokenizer: unknown macro without semicolon) 2019-11-02 19:34:19 +01:00
Daniel Marjamäki
28182084f2 Fix crash when there are too many nested scopes. Bail out after 1000 nested scopes. The crash was in gcc and was seen with daca@home. 2019-11-02 18:23:10 +01:00
Daniel Marjamäki
29778fdddb readme: Donate CPU 2019-11-02 08:25:04 +01:00
Daniel Marjamäki
42432982ea oss-fuzz: fixed inner assignment 2019-11-02 08:00:42 +01:00
Dmitry-Me
0b97f37736 Improve test coverage 2019-11-01 18:41:10 +03:00
Dmitry-Me
f2cf71f6e9 Fix typo 2019-11-01 18:39:53 +03:00
Sebastian
4f927ea6c7
htmlreport: Add HTML validation and fix syntax errors (#2317)
Add HTML validation with HTML Tidy for the resulting files index.html
and stats.html.
Fix syntax errors found by the validator.
Fix that the links in the footer are not clickable by removing the
"height: 75%;" style for the classes "menu" and "menu_index".
Add some line breaks to the HTML output for better readability and for
easier debugging.
2019-11-01 15:06:44 +01:00
Maksim Derbasov
91a4bcd71e Triage tool usability improvement (#2319)
* gitignore for triage tool

* window header

* Search filename / in files functionallity for triage tool

* small codeclean
2019-11-01 09:29:00 +01:00
IOBYTE
3f0ef01154 Fix #9446 (Syntax error on valid C++ code) (#2316) 2019-11-01 09:11:29 +01:00
Sebastian
e9bc62d5b4 .travis.yml: Install pygments via pip instead of apt (#2318)
This way we should get a newer version of pygments.
2019-11-01 09:10:10 +01:00
Daniel Marjamäki
35d04cd2d3 AST: non-standard handling of ; in argument list for unknown macro 2019-11-01 09:05:45 +01:00
Armin Müller
bdd41151ed Typos found by running "codespell" (#2314) 2019-10-31 15:03:18 +01:00
Daniel Marjamäki
6e9d496ab3 ValueFlow: handling of char literal size before ValueType has been set 2019-10-31 14:06:46 +01:00
Sebastian
db7cddf163 cppcheck-htmlreport: Fix premature end of loop in statistics output (#2313)
This issue and also a fix has been reported by Lionel Gimbert in the forum:
https://sourceforge.net/p/cppcheck/discussion/development/thread/d18fb312ee/
All credit goes to him.
2019-10-31 09:26:43 +01:00
Sebastian
8b2903d5ce openssl.cfg: Add OpenSSL library configuration with tests (#2248)
* openssl.cfg: Add OpenSSL library configuration with tests

Reference: https://www.openssl.org/docs/man1.1.1/man3/

* openssl.cfg: Add some configurations for EVP functions

Add alloc/dealloc configuration for EVP_CIPHER_CTX_new and
EVP_CIPHER_CTX_free.
Add configuration for encryption functions that are used in example code
which is added to the tests.
2019-10-31 09:21:08 +01:00
versat
181e1baa69 cppcheck.vcxproj.filters: Also update this Visual Studio file
This .filters file has been automatically updated by Visual Studio when
the two new files were added. So it should also be updated.
2019-10-31 09:05:58 +01:00
Daniel Marjamäki
9094ff01d3 Fixed #9363 (knownConditionTrueFalse: False positive about function parameter) 2019-10-31 08:34:09 +01:00
orbitcowboy
7c2c81bf41 wxwidgets.cfg: Added support for more EVT-macros, found by daca@home. 2019-10-31 08:32:13 +01:00
versat
470f0cdfe3 lib/cppcheck.vcxproj: Fix Visual Studio build, add new files. 2019-10-31 08:29:19 +01:00
Daniel Marjamäki
6d1c84e3a6 Fixed #9449 (SymbolDatabase: Function lookup fails when string literal is converted to bool) 2019-10-30 21:05:42 +01:00
Daniel Marjamäki
b96a347914 Tokenizer: Report unknown macro when argument list contains if/for/while/switch 2019-10-30 19:36:19 +01:00
Daniel Marjamäki
33d43808f7 Run dmake 2019-10-30 18:38:37 +01:00
Daniel Marjamäki
8c591308cb astyle formatting
[ci skip]
2019-10-30 18:19:45 +01:00
Sebastian
816aa7e211
Fix and re-enable htmlreport tests (#2310)
* htmlreport/check.sh: Remove check with obsolete file

gui/test/data/xmlfiles/xmlreport_v1.xml has been removed with commit
d95efc44c7ece86bed9b9e6f4874a615bdaf107d

* .travis.yml: Enable htmlreport test again

* cppcheck-htmlreport: Fall back to guessing lexer from file content

If the lexer can not be guessed from the file extension (for example
for *.tpp) then guess the lexer that should be used from the content.
This fixes "ERROR: *" output when running "htmlreport/check.sh"
Also use specific exceptions instead of bare ones.
2019-10-30 18:01:39 +01:00
Paul Fultz II
694d147097 Refactor ProgramMemory and PathAnalysis (#2311)
* Traverse conditions for container size

* Move program memory to seperate file

* Revert "Traverse conditions for container size"

This reverts commit 914783769f25391a3c49fab73be478383ec8f920.

* Move pathanalysis to seperate files
2019-10-30 17:57:46 +01:00
Rikard Falkeborn
239b660a52 Fix #9438 (Don't warn for return (void*) malloc(1)) (#2307) 2019-10-30 17:55:47 +01:00
Daniel Marjamäki
277c59e5f3 AST: Fixed AST for lambda that returns template type 2019-10-30 16:05:34 +01:00
IOBYTE
02e7f4f61c Fix template templates where the template template parameter is not the first parameter. (#2309) 2019-10-30 12:12:47 +01:00
Paul Fultz II
02150e741d Fix issue 7836: Add regression test (#2308) 2019-10-30 12:12:02 +01:00
Sebastian
02c0240dcd
Fix #9322: bsd.cfg, gnu.cfg: Fix FP for mmap when argument "fd" is -1 (#2306)
In contrast to POSIX, GNU and BSD allow or even require the argument
"fd" to be set to -1 if MAP_ANONYMOUS or MAP_ANON is specified.
2019-10-30 09:39:50 +01:00
Daniel Marjamäki
210232d35c Fixed #9314 (false positive: (error) Uninitialized variable: ret) 2019-10-29 20:36:58 +01:00