Commit Graph

19969 Commits

Author SHA1 Message Date
orbitcowboy a46136de91 wxwidgets.cfg: Added wxPathFormat constants. 2019-04-08 13:27:34 +02:00
orbitcowboy f6136c513a wxwidgets.cfg: Added support for wxFileName::GetPathSeparator(). 2019-04-08 11:47:09 +02:00
Daniel Marjamäki d2949adff1 misc.py: Make it possible to run this addon from cppcheck 2019-04-07 21:07:08 +02:00
Daniel Marjamäki a508b2abfd Addons: Add same handling in Windows as in Linux 2019-04-07 19:53:34 +02:00
Daniel Marjamäki 58d88e149f Add --addon=<addon> command line option 2019-04-07 17:44:43 +02:00
Daniel Marjamäki bf9006737a Addons: Adding support in Cppcheck CLI to execute addons 2019-04-07 17:01:59 +02:00
orbitcowboy 64f0744242 Merge branch 'master' of https://github.com/danmar/cppcheck 2019-04-07 13:27:47 +02:00
orbitcowboy 0ace50204b Fixed a crash on garbage code. The test input was found by afl_cppcheck (type2). Unforunately, the cppcheck-fuzzer-client was crashing only when executing the binary input from afl-fuzz. Using the translated-input (C-code) did not lead to crash. I tested it with activated address/undefined behaviour sanitizer as well as non-instrumented source code. Since the translated output is too long (164 lines), i will not add it the testgarbage.cpp. 2019-04-07 13:27:33 +02:00
Daniel Marjamäki 7ec8ce2ece --help: arguments should be written in alphabetical order 2019-04-07 13:20:23 +02:00
Daniel Marjamäki 6d7ec98dd6 Import Project: import suppressions from gui project 2019-04-07 13:15:25 +02:00
Daniel Marjamäki 111db91387 ImportProject: Import excluded paths properly 2019-04-07 12:31:52 +02:00
Daniel Marjamäki c04cc02ee5 Refactoring; Use range for loop 2019-04-07 12:07:47 +02:00
Daniel Marjamäki 3701db96a3 Refactoring; use range for loop 2019-04-07 11:58:42 +02:00
Daniel Marjamäki 83106d5827 Unused templates: Remove unused template function with variadic arguments 2019-04-07 08:37:04 +02:00
Daniel Marjamäki 7237acdb47 GUI: In the project dialog select libraries in a listbox 2019-04-06 16:44:43 +02:00
Rikard Falkeborn 82a1e3c61c CheckInternal: Extend redundant null pointer check before Token::Match() (#1789)
Improve the internal check for redundant null pointer check before
calling Token::Match() (and friends). Now, warn about code snippets like

    if (a && tok && Token::Match(tok, "foo"))

Also, extend the check for the inverted case.

There is still no warning for

    if (tok && a && Token::Match(tok, "foo"))

since that would require checking if a is independent of tok.
2019-04-06 07:44:44 +02:00
Rikard Falkeborn d23e987941 Fix CheckInternal warnings (#1790) 2019-04-06 06:55:46 +02:00
Rikard Falkeborn 295153df72 Checkstring fixes (#1783)
* teststring.cpp: Fix ternary syntax in tests

* stringLiteralWrite: Add tests wide character and utf16 strings

* suspiciousStringCompare: Add test with wide character string

* strPlusChar: Handle wide characters

* incorrectStringCompare: Add test with wide string

* Suspicious string compare: suggest wcscmp for wide strings

* deadStrcmp: Extend to handle wide strings

* sprintfOverlappingData: Print name of strcmp function

* Conversion of char literal to boolean, add wide character tests

* Conversion of char literal to boolean, fix ternary
2019-04-06 06:54:38 +02:00
Oliver Stöneberg 16ebb90b32 library.cpp: optimized Library::detectContainer() (#1778)
* library.cpp: optimized Library::detectContainer()

reduces Ir from 5882 to 1149 according to callgrind

* fixed hang in tests
2019-04-06 06:42:01 +02:00
daisuke-chiba 6ab6cfe42f Fix typo. (#1788)
Fix wrong Japanese character.
2019-04-05 16:09:47 +02:00
IOBYTE 2b6d599f1e donate-cpu.py: show size of results sent to server (#1784) 2019-04-05 14:11:03 +02:00
eivindt 0debd8d520 Misra xml output (#1787)
* Add (very) simple XML output support

* Removed xml top and tail, better handled outside
2019-04-05 12:36:58 +02:00
versat 5eeeb0def2 Run dmake 2019-04-05 11:35:52 +02:00
orbitcowboy 501cea7e01 wxwidgets.cfg: Fixed wrong configuration for wxString::Mid() 2019-04-05 09:31:48 +02:00
orbitcowboy 1b9b5168d0 daca.cfg: Turned macros into functions to avoid problems with macros like 'MIN(a,b,c)'. 2019-04-05 09:28:15 +02:00
orbitcowboy 45a7038fbb wxwidgets.cfg: Added supprot for more interfaces 2019-04-05 09:27:23 +02:00
orbitcowboy b0168066dc Added daca.cfg. 2019-04-05 09:05:31 +02:00
orbitcowboy 3d765eacaf wxwidgets.cfg: Added support for more interfaces. 2019-04-05 08:44:06 +02:00
orbitcowboy 0590cebaac wxwidgets.cfg: Added support for more interfaces. 2019-04-05 08:27:24 +02:00
Oliver Stöneberg 6e6cdae20e donate-cpu.py: improved error handling when fetching cppcheck version (#1780)
During a local scan it did not get any cppcheck versions causing the script to fail with an exception when creating the diff.
2019-04-04 13:09:35 +02:00
IOBYTE 5cdde701ba template simplifier: add minimal template template support (#1779) 2019-04-04 06:07:49 +02:00
Sebastian d8d4ca51d7
manual.md: Fix markdown lint warnings. (#1773) 2019-04-03 20:05:04 +02:00
eivindt 76bf5ecb06 Map MISRA violation categories to cppcheck categories (#1775) 2019-04-03 19:39:05 +02:00
eivindt 480284d428 Show number of hits per suppression rules entry (#1776) 2019-04-03 19:38:03 +02:00
versat e0e262ae25 gnu.cfg: Use function configuration for `_()` instead of define.
There can be preprocessor issues if the macro is used slightly different
or preprocessor conditions are used inside the string argument.
So now a function configuration with very few assumptions is used.
It is assumed that the function does return and has one parameter.
The same configuration is added for N_() since it works similar.
2019-04-03 16:02:55 +02:00
versat 20814d37d0 donate-cpu-server.py: Fix wrong detection of invalid messageIds.
Packages now can contain something like:
```
    head results:
    Checking temp/openvdb/Platform.cc: __GNUC__=1...
    [New Thread 7892.0x91c]
```
"New Thread 7892.0x91c" was wrongly identified as messageId in the HEAD
report.
This commit adds code to skip lines that start with `[` or where the
messageId contains at least one space.
2019-04-03 11:46:45 +02:00
Oliver Stöneberg 8c26d4ee6a donate-cpu.py: more error detection improvements / properly update data on server (#1768)
* donate-cpu.py: made exitcodes > 0 negative so they will be detected a crash / changed the ThreadExecutor error to -222

* donate-cpu.py: unconditionally upload results and info now that errors are properly handled - will also properly clear the result/info in case there are no more messages

* donate-cpu.py: bumped version

* donate-cpu.py: added stdout to output in case of exitcode != 0

* donate-cpu.py: do not scan packages with no relevant files

* donate-cpu.py: bumped version
2019-04-03 09:27:04 +02:00
orbitcowboy 7ac3bf5fd8 std.cfg: Removed MIN/MAX macros since they cause problems with http://cppcheck.osuosl.org:8000/amap-align 2019-04-03 09:11:48 +02:00
Daniel Marjamäki de4f57ec0f Buffer overflow: Add CTU checking for pointer arithmetic overflows 2019-04-03 06:43:56 +02:00
IOBYTE 9f3ecdde31 Fixed #9076 (Template Simplifier : template < template <typename> T >) (#1777)
This does not add support for template templates.  It only skips the
template template parameter.
2019-04-03 06:02:38 +02:00
Daniel Marjamäki 3f9dd4c567 Variable scope: Fix FP for reference variable in range for loop 2019-04-02 12:59:24 +02:00
versat 6b9a25869e donate-cpu.py: Improve upload error handling, remove old "fast" code.
If an upload fails, the reason (exception text) is now printed.
Fix: If the last retry failed do not wait until continuing.
Remove some obsolete "fast" code in the uploadResults() function.

Tested with Python 2.7.16 and Python 3.6.8.
2019-04-02 10:23:57 +02:00
IOBYTE f5cb289b7d template simplifier: fix another crash (#1774)
This fixes a daca crash in Vc-1.3.3/tests/casts.cpp.
2019-04-02 09:00:11 +02:00
Daniel Marjamäki b88cc7c19d Fix std.cfg 2019-04-01 20:28:31 +02:00
Daniel Marjamäki 761f18c75c Fixed #8988 (False positive: using memset on struct) 2019-04-01 19:32:03 +02:00
versat 974f01ce59 gtk.cfg: Add / improve g_str*() functions and add GTK_SIGNAL_FUNC(). 2019-04-01 16:15:32 +02:00
versat 9d8b965270 gtk.cfg: Add / improve g_string_*() function configurations.
daca@home reported missing configurations for most of them.
2019-04-01 15:33:27 +02:00
versat 5134fefb52 gnu.cfg: Add support for bswap*() macros. 2019-04-01 14:25:59 +02:00
versat 7832d69edf windows.cfg: Add *LANGID() macros. 2019-04-01 13:58:56 +02:00
versat 5fb23a4983 manual.md: Fix wrong code indentation. 2019-04-01 13:30:24 +02:00