20424 Commits

Author SHA1 Message Date
fuzzelhjb
9a7ecd622c add CERT exp15-c check (#1897)
* add CERT exp15-c check

* fix false positive

* remove useless check

* fine tune check and test
2019-06-26 18:49:47 +02:00
Daniel Marjamäki
cf1f353ec3 readme.md: Removed 'donations' 2019-06-26 07:43:53 +02:00
Scott Furry
fc61596c40 Adjustments to CMake Building (#1925)
From CMake Docs( https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html ),
BUILD_SHARED_LIBS may not be defined. This can result in printinfo.cmake outputing
variable without a value. A conditional is applied to ensure that some output is
provided to the user should variable not be defined.

Removed explicit C++ standard flag. Any setting user would add on the command
line would be replaced due to ordering. `-std=c++0x` would be last value added
to CMAKE_CXX_FLAGS and ultimately the one used by the compiler.
2019-06-26 07:41:48 +02:00
Georgy Komarov
be5778c416 misra.py: Expand ~ in file paths (#1924) 2019-06-26 07:30:08 +02:00
Scott Furry
158194d923 Propagate Monospaced Font to Line Number Area in Code Editor (#1923)
Styling change missed in #1913.
2019-06-25 20:22:02 +02:00
Sebastian
d745dcc0eb
gtk.cfg: Add g_error_*() functions (#1922) 2019-06-25 19:19:10 +02:00
Sebastian
ba0ca5d087
addons/misra.py: Fix comparison instead of assignment (#1920) 2019-06-25 19:18:31 +02:00
Sebastian
d1386112a9
addons/cppcheckdata.py: Fix missing self, and wrong assignment. (#1919)
I am not sure but it looks like "self." is missing here.
And the attribute "inconclusive" is initialized as a "bool", so i guess
"True" should be assigned here?
2019-06-25 19:16:57 +02:00
Sebastian
a437a22460
windows.cfg: Add GetDlgItem() (#1921)
Reference:
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getdlgitem
2019-06-25 15:31:42 +02:00
versat
b1e2b9d61b astyle formatting
[ci skip]
2019-06-25 15:29:15 +02:00
Daniel Marjamäki
b0e56f873f GUI: Use --cli option when running addons to get results in json format 2019-06-25 01:22:50 +02:00
Georgy Komarov
5d58b14db8 misra.py: Update output according c97dc79 (#1917) 2019-06-25 00:42:13 +02:00
amai2012
709061ba54 Update include path 2019-06-24 20:53:19 +02:00
Daniel Marjamäki
c97dc79815 --addon: Use json for addon output 2019-06-24 19:29:43 +02:00
Paul Fultz II
66e0f06494 Fixx issue 9163: FP returnDanglingLifetime - returning std::string::find (#1912)
* Fixx issue 9163: FP returnDanglingLifetime - returning std::string::find

* Use simpleMatch
2019-06-24 18:52:17 +02:00
fuzzelhjb
f36d671bc5 add CERT STR03-C check (#1898)
* add CERT STR03-C check

* fix cert test
2019-06-24 18:41:43 +02:00
Scott Furry
0d76d078e2 Implement User Selectable Code Editor Style in cppcheck-gui (#1913)
Building on #1874, commit adds user controls to choose
or edit style in cppcheck-gui ONLY. Commit does not
address CodeEditor style usage in triage app at this time.

Code Editor style can be altered from the added "Code Editor"
tab in the user preferences. The user has the option to select
default light, default dark, or to customize.

If user leaves the style set to light or dark defaults, this
will be reflected in the choices shown in the preferences
dialog.

User choice for Code Editor Style is saved in the cppcheck-gui
preferences under the heading "EditorStyle".
2019-06-23 19:04:53 +02:00
Georgy Komarov
05bb4a0c8f misra.py: Fixup rules severity (#1911)
* misra.py: Fixup rules severity

* Divide cppcheck and MISRA severity.
2019-06-23 14:08:05 +02:00
Daniel Marjamäki
bd59999fd0 cert.py: Use cppcheck.getArguments instead of local implementation 2019-06-23 14:05:24 +02:00
fuzzelhjb
8fcfe0ceb0 add CERT STR07-C check 2019-06-23 13:59:24 +02:00
Daniel Marjamäki
63bd29d644 addons/cppcheckdata.py: Add 'cppcheckdata.getArguments' function 2019-06-23 13:54:33 +02:00
Daniel Marjamäki
1b4485a738 Makefile: Add one more flag 'MATCHCOMPILER=yes' 2019-06-23 13:43:09 +02:00
IOBYTE
46b543ba27 template simplifier: stop running passes when nothing was simplified. (#1914) 2019-06-23 10:55:09 +02:00
Daniel Marjamäki
175070ca50 Revert "Fixed #8938 (FP identicalInnerCondition)"
This reverts commit 0edf0b562855f0c6d5569a3995cb380ed1d5fc6e.

This bailout seems to cause many false negatives
2019-06-22 21:57:19 +02:00
Daniel Marjamäki
de9c999d79 Better handling of spaces in paths 2019-06-22 19:20:15 +02:00
Daniel Marjamäki
7ceb51a952 Try to improve 'clarifyStatement' warning message 2019-06-22 08:44:41 +02:00
Daniel Marjamäki
16bed07c60 Clarify tests 2019-06-22 07:50:43 +02:00
Daniel Marjamäki
beea7fa8d2 Token::index(): Created Token member that indicates the Token position in the token list. It can be used to quickly check if tok1 precedes tok2. 2019-06-21 22:16:23 +02:00
Daniel Marjamäki
d636a83f8b Tokenizer: Assign Token 'progressValue' before returning so they are set properly when the checks are run 2019-06-21 08:43:19 +02:00
orbitcowboy
bb802c0c63 windows.cfg: Added support for constants from 'RpcDce.h: Impersonation Level Constants'. 2019-06-20 15:40:39 +02:00
orbitcowboy
3b3e7fd382 windows.cfg: Added support for _itoa_s()-functions. 2019-06-20 15:25:05 +02:00
orbitcowboy
952a4becf6 std.cfg: Added return type to itoa(). 2019-06-20 15:24:35 +02:00
Daniel Marjamäki
c98ceb6e14 Tweak bailout so it's only used in unused template classes 2019-06-20 14:00:44 +02:00
Sebastian
1a4854d93d
windows.cfg: Add macros STDMETHODIMP[_] and STDMETHODCALLTYPE (#1908) 2019-06-20 00:44:43 +02:00
Daniel Marjamäki
cf79830afd Revert "Remove bailout. It hides lots of warnings for real code to avoid FP in unused templates."
This reverts commit 2a4be5ae1c466376351b82fcfeadb4b79c877575.

When I look at daca@home now there are still lots of false negatives. So this bailout did not cause as much false negatives as I thought.
2019-06-19 22:29:00 +02:00
Georgy Komarov
02cc9ffcd8 misra.py: Add --verify-rule-texts option. (#1909)
* misra.py: Add verify-rule-texts option.

* Capture stdout output in travis.
2019-06-19 21:57:27 +02:00
orbitcowboy
a5185c7005 wxwidgets.cfg: Added support form ore interfaces. 2019-06-19 15:33:28 +02:00
orbitcowboy
fa20c1671b wxwidgets.cfg: Added support for wxButton::Bind(). 2019-06-19 14:58:54 +02:00
orbitcowboy
067a70ec03 wxwidgets.cfg: Restrict input parameters. No negative status bar field is allowed. 2019-06-19 13:40:39 +02:00
orbitcowboy
aecd4ed765 wxwidgets.cfg: Added support for more interfaces. 2019-06-19 13:25:20 +02:00
orbitcowboy
e8703036c3 wxwidgets.cfg: Added support for more interfaces. 2019-06-19 13:14:52 +02:00
Ken-Patrick
44d6066c6f FP on assignment through pointer (#1887)
* Fix FP when assigning through pointers

* Add test case for false positive

cppcheck would faulty warn:
"Condition '*b>0' is always true"
2019-06-17 21:25:15 +02:00
IOBYTE
246576fceb Fixed #9178 (Assertion `brackets1.empty() == false' failed on valid C++ code) (#1905)
This fixes a nasty intrinsics related bug causing instantiations that
shouldn't happen.
2019-06-17 21:18:27 +02:00
Georgy Komarov
e979b0652c misra.py: Fix up and improve load rules parser. (#1895)
* misra.py: Fixup load rules parser.

* misra.py: Report when rule text is missing in rule-texts file

* misra.py: Allow to skip misra checks not specified in rule-texts.

* misra.py: Remove top-level control flow.

Create separate class that stores settings, instead of global variables.

This is required to perform imports from misra.py for testing purposes.

* misra.py: Add simple pytest test for load rules.

* misra.py: Add document structure tests.

* misra.py: Exit after show rules table.

* misra.py: Add document structure tests.

* misra.py: Fixup import pitfall with python2

* misra.py: Minor fixes
2019-06-17 21:17:29 +02:00
fuzzelhjb
5e3da9e82a add CERT STR05-C check (#1899)
* add CERT STR05-C check

* update check
2019-06-17 20:42:23 +02:00
Rikard Falkeborn
b1c8d81bcc Refactoring; Use range for loop (#1900) 2019-06-17 13:17:45 +02:00
Jim Zhou
071fc85a05 minor corrections (#1906) 2019-06-17 07:04:08 +02:00
Daniel Marjamäki
59c7be307c Travis: Fix test/cli testing 2019-06-16 19:11:12 +02:00
Daniel Marjamäki
2a4be5ae1c Remove bailout. It hides lots of warnings for real code to avoid FP in unused templates. 2019-06-16 19:01:45 +02:00
Rikard Falkeborn
d909ac8565 Bugfix buffer size for strdup like functions (#1893)
strdup() allocates the string length plus one for a terminating null
character. Add one to compensate for this.

Fixes false positive buffer out of bounds on code like this:

	void f() {
		const char *a = "abcd";
		char * b = strdup(a);
		printf("%c", b[4]); // prints the terminating null character
		free(b);
	}

Also, add a testcase for valueFlowDynamicBufferSize() and add tests for
strdup(), malloc() and calloc().
2019-06-16 16:02:27 +02:00