Commit Graph

664 Commits

Author SHA1 Message Date
Daniel Marjamäki d0ac583b97 Add 'bughuntingchecks' 2020-06-19 13:16:48 +02:00
Daniel Marjamäki 9cdad2fb33 Set debug mode 2020-06-13 18:09:27 +02:00
Daniel Marjamäki 0f23bde2b0 2.1: Set release mode in Makefile 2020-06-13 18:08:37 +02:00
Oliver Stöneberg 37bc0483a4
made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
Daniel Marjamäki e2ead44a2d dmake updates. externals/z3_version.h should never be added as a dependency 2020-05-19 20:14:29 +02:00
Daniel Marjamäki 32e569704b executeCommand in CppCheckExecutor or QCheckThread 2020-05-19 16:04:40 +02:00
amai2012 d78ff975a0 Run dmake 2020-05-19 10:11:56 +02:00
Daniel Marjamäki 330e634937 Revert "TestTrac: Add separate file for black box / integration tests in testrunner"
This reverts commit e895fa4c3f.
2020-05-19 07:53:54 +02:00
Daniel Marjamäki e895fa4c3f TestTrac: Add separate file for black box / integration tests in testrunner 2020-05-18 20:22:00 +02:00
Daniel Marjamäki 6fb014a07a Generate new Makefile by dmake without externals/z3_version.h 2020-05-15 18:28:18 +02:00
Daniel Marjamäki fd09c6e8a5 run dmake 2020-05-15 17:17:22 +02:00
Oliver Stöneberg a0317477c9
utils.h: avoid unnecessary string creation in isStringCharLiteral() (#2638)
* utils.h: avoid unnecessary string creation in isStringCharLiteral()

reduces Ir from 541 to 63 in a test

* dmake
2020-05-14 14:45:35 +02:00
Daniel Marjamäki db6135dd13 Makefile: DEBUG 2020-05-10 14:15:03 +02:00
Daniel Marjamäki aad6dc4367 2.0: Updated Makefile 2020-05-10 11:31:19 +02:00
amai2012 12aa8b0e65 Run dmake 2020-04-19 11:17:59 +02:00
amai2012 efeb7deb7a Run dmake and astyle 2020-02-16 19:58:09 +01:00
Paul Fultz II 7368a54629
Add generic valueflow forward analysis (#2511) 2020-02-13 16:27:06 +01:00
Rikard Falkeborn a955524311 Run dmake (#2506) 2020-01-26 08:23:15 +01:00
amai2012 7a2c10f9f1 Run astyle 2020-01-13 10:40:36 +01:00
amai2012 00e017722f Run dmake 2020-01-11 14:43:58 +01:00
Daniel Marjamäki 4c778e0999 Clang import; Rename files/namespace 2020-01-10 16:29:06 +01:00
Daniel Marjamäki 6a4a59b783 Clang Import; Added test 2020-01-06 16:45:18 +01:00
Daniel Marjamäki b03bdfaf72 Import Clang ast dump (experimental) 2020-01-05 15:12:53 +01:00
Daniel Marjamäki cb9381e620 Makefile: Set debug mode 2019-12-21 12:10:10 +01:00
Daniel Marjamäki 077e652de4 1.90: Makefile 2019-12-21 11:51:10 +01:00
amai2012 3a71eb834d Run xmllint on cppcheck-errors.rng. Speed up creation of example XML output for validateXML target 2019-12-02 22:03:59 +01:00
amai2012 0024c3e446 Run xmllint on cfg/cppcheck-cfg.rng 2019-11-17 16:25:10 +01:00
Daniel Marjamäki 33d43808f7 Run dmake 2019-10-30 18:38:37 +01:00
Sebastian 75e4e70ce4
Fix #9299 (Makefile: tools/matchcompiler.py is executed via Python 2) (#2247)
Check if "python" is available, if not check for "python3" and use
the available Python interpreter. If no Python interpreter is found,
"make" fails with an according error message.
This solves the issue that not all modern Linux distributions any longer
install Python 2 by default, so "python" is not available and
"make MATCHCOMPILER=yes" would fail. Instead of forcing the users to
install Python 2, Python 3 is used in such a case now if it is
available.
2019-10-08 10:55:40 +02:00
Daniel Marjamäki 7ab22c7176 ExprEngine: Use smt solver Z3 2019-10-02 17:59:04 +02:00
amai2012 16f1d8196b Add validateRules target (xmllint) for rules/*.xml 2019-09-21 20:33:48 +02:00
Rikard Falkeborn 46ac0d79c1 Checkmemleakautovar: fix crash and FP (#2196)
This fixes crashes found by daca where valueType() is NULL. Also,
somewhat related, it removes warnings when casting to a type that is
unknown to cppcheck, for example, there is no longer a warning for the
following code:

	void* f() {
		void *x = malloc(1);
		return (mytype)x;
	}
2019-09-21 14:59:54 +02:00
Rikard Falkeborn 518bb5195c dmake: Sort header dependencies (#2182)
Makes it simpler to check diffs, and prevents updates to Makefile due to
changes in header includes.
2019-09-19 09:26:59 +02:00
Daniel Marjamäki 2d651b09fc ExprEngine: Add new experimental path-sensitive data flow analysis. Initially used for 'verification' but could possibly later be used as a complement in the normal analysis. The code is work-in-progress and hacky! 2019-09-17 21:00:59 +02:00
Rikard Falkeborn afe05d019c dmake: Improve dependency detection of external and cli includes (#2163)
Previously, external files were not searched at all, and dependencies
on header files in cli was not taken into account for test files.

To add dependency of headers in externals, we also need to search for
includes with angular brackets.
2019-09-10 10:32:36 +02:00
Daniel Marjamäki c07d5f0161 Makefile: Set debug mode 2019-09-01 15:01:55 +02:00
Daniel Marjamäki 355d2ccf47 Makefile: Set release mode 2019-09-01 15:01:12 +02:00
Daniel Marjamäki a17f2a6f05 Compiling/Installing : The CFGDIR parameter was removed. Use FILESDIR instead. 2019-08-17 10:53:07 +02:00
Rikard Falkeborn f139558d90 Dmake cleanups (#2077)
* dmake: Refactor object files to separate function

No functional change.

* dmake: Use range for loops

No functional change.

* Add all external cpp files instead of open coding

No functional change.

* Remove duplicate check.h in lib.pri HEADERS

* Add missing newline

No functional change, but the readability of the generated Makefile is
slightly improved.
2019-08-14 20:53:51 +02:00
versat 61ddda6252 run dmake 2019-07-17 10:02:28 +02:00
Sebastian 7d7078f126 Makefile/dmake: Increase stack size to 8M for Cygwin builds to avoid segfaults (#2001)
* Makefile: Increase stack size to 8M for Cygwin builds to avoid segfaults

See https://github.com/danmar/cppcheck/pull/1988
and https://github.com/danmar/cppcheck/pull/1998

* dmake.cpp: Add parameter to CXXFLAGS for increased stack size in Cygwin
2019-07-16 12:14:18 +02:00
Daniel Marjamäki 17c5587ac5 Restore Makefile after release 2019-06-29 10:22:35 +02:00
Daniel Marjamäki 069ecb0a50 1.88: Update Makefile 2019-06-29 09:24:02 +02:00
Daniel Marjamäki 1b4485a738 Makefile: Add one more flag 'MATCHCOMPILER=yes' 2019-06-23 13:43:09 +02:00
Carlo Marcelo Arenas Belón bf5c71bdca sync (#1835)
* build: remove -Wabi and add -Wundef

gcc >= 8 throws a warning about -Wabi (without a specific ABI version)
being ignored, while -Wundef seems more useful (as shown by the change
in config.h, which was probably an unfortunate typo)

travis.yaml should probably be updated soon, but was left out from this
change as the current images don't yet need it

* lib: unused function in valueflow

refactored out since 8c03be3212

lib/valueflow.cpp:3124:21: warning: unused function 'endTemplateArgument' [-Wunused-function]

* readme: include picojson

* make: also clean exe
2019-05-17 09:31:41 +02:00
Daniel Marjamäki ece13033b2 dmake: use -isystem for externals to avoid compiler warnings 2019-04-19 14:52:49 +02:00
versat 5eeeb0def2 Run dmake 2019-04-05 11:35:52 +02:00
versat 5036cb9ca6 Run dmake 2019-03-25 13:28:03 +01:00
versat d3893a2b3f Run dmake 2019-03-18 13:39:42 +01:00
Daniel Marjamäki 5e88258005 Makefile: Remove reduce target 2019-03-02 12:11:04 +01:00
Daniel Marjamäki 979e196895 Restore Makefile 2019-02-09 09:32:34 +01:00
Daniel Marjamäki f45cecc303 Makefile: Set release mode 2019-02-09 09:31:27 +01:00
IOBYTE 1faae52d06 Fixed #8960 ("(debug) Unknown type 'x'." with alias in template class alias) (#1643)
* Fixed #8960 ("(debug) Unknown type 'x'." with alias in template class alias)

This commit adds non-template type alias support to the template
simplifier.  Only relatively simple type aliases are supported at this
time. More complex types will be added later.

--debug-warnings will show unsupported type aliases.

Type alias support will be removed from the symbol database in the
future.  Type alias tests have been removed from the symbol database
tests.

* Add the changes.

* Fix codacy warning.

* Fix travis warnings.
2019-02-05 08:52:23 +01:00
Daniel Marjamäki e297e3a505 Update Makefile 2019-01-31 21:31:14 +01:00
rikardfalkeborn 0c9b4fe279 Update Makefile (#1636) 2019-01-31 21:30:32 +01:00
rikardfalkeborn a48c8abcda Fix 8124: False positive va_end missing with lambda (#1577)
Skip lambdas, to avoid false positives due to possible
return statements in lambdas.

Also, run dmake.
2019-01-10 18:32:17 +01:00
amai2012 94f2daccb2 Update Makefile 2019-01-06 09:33:36 +01:00
amai2012 cc4ca7525a
Clean up redundant actions in travis jobs (#1563)
* Clean up redundant actions in travis jobs.
* Drop validatePlatforms from Makefile target checkcfg
* Print out CPU count. Adjust parameters for parallel jobs to 2 - the current result.
2019-01-05 11:12:32 +01:00
Daniel Marjamäki 271763e680 CTU: Refactoring 2018-12-25 21:11:23 +01:00
Daniel Marjamäki 81e6d67d2c Debug Makefile 2018-12-08 08:23:50 +01:00
Daniel Marjamäki 5b897a7a4a 1.86: Release Makefile 2018-12-08 08:18:21 +01:00
Daniel Marjamäki 42e516582c Disable shadow warnings when compiling 2018-11-19 09:25:59 +01:00
amai2012 f1ce40a918 Update Makefile 2018-11-14 09:01:08 +01:00
amai2012 39c2625789 Run check for missing CWE entries on travis. 2018-10-22 13:14:48 +02:00
Christian Franke f228897641 make: Add uninstall target 2018-10-19 09:49:44 +02:00
Daniel Marjamäki 35f3d29093 Makefile: Restore debug mode 2018-10-14 15:14:48 +02:00
Daniel Marjamäki e22243ae0d Makefile: Set release mode 2018-10-14 14:56:51 +02:00
amai2012 b6103d15a6 #8711 Run Makefile target validateXML on travis 2018-09-24 14:27:02 +02:00
amai2012 8fee6cce84 Supply update to Makefile missing from previous commit 2018-09-24 13:16:20 +02:00
amai2012 cf8523b198 #8711 Extend XML being generated to validate the XML output format by adding an unmatchedSuppression. Also use proper cppcheck executable to generate them 2018-09-24 13:13:05 +02:00
Matthias Krüger f965e5873d checkstl: remove uused variable 'beginCondTok'
Was:
lib/checkstl.cpp:2022:30: warning: unused variable 'beginCondTok' [-Wunused-variable]
                const Token *beginCondTok = condBodyTok->previous()->link();
                             ^

also run dmake to update Makefile
2018-09-22 21:10:21 +02:00
Matthias Krüger 017f910c57 gui: fix 2 findings by cppcheck
[gui/projectfiledialog.h:283]: (performance) Function parameter 'shortText' should be passed by const reference.
[gui/projectfiledialog.cpp:675]: (performance) Function parameter 'shortText' should be passed by const reference.

also run dmake
2018-08-09 09:43:11 +02:00
Matthias Krüger 0b308dd095 run dmake 2018-07-16 10:48:49 +02:00
Daniel Marjamäki c7c9064e54 Makefile: Set debug mode 2018-06-10 23:36:45 +02:00
Daniel Marjamäki be3441be6e Update Makefile for release
[ci skip]
2018-06-10 22:24:10 +02:00
amai2012 453c663fb0
#8611 Rename xmlV2.rng. Renaming it to cppcheck-errors.rng (#1278) 2018-06-06 15:25:09 +02:00
Matthias Krüger 26e5c93e37 run dmake 2018-05-31 12:31:03 +02:00
amai2012 ceff09d491 #5178 Supply DTD/(XSD/RNG for cppcheck XML output. Add target to Makefile to create and validate XML from regular run. Update xmlV2.rng accordingly. 2018-05-24 16:12:43 +02:00
amai2012 64f0d31280 #5718 Supply DTD/XSD/RNG for cppcheck XML output - supply rng for current XML output. Add an automatic check on travis against the --errorlist output 2018-05-17 12:46:15 +02:00
Matthias Krüger cc74d64c1e run dmake 2018-05-10 12:28:03 +02:00
Matthias Krüger 5272197e3f run dmake 2018-04-27 13:11:51 +02:00
alexander 795f244804 Omit test/synthetic from tags file 2018-04-19 22:42:04 +02:00
Sebastian 3b68c913cb
testrunner: Add testplatform to verify platform loading (#1176) 2018-04-18 16:12:35 +02:00
versat 8e53f17922 Run dmake 2018-04-17 16:23:06 +02:00
Daniel Marjamäki 8c082f1b3f Remove lib/cxx11emu.h 2018-04-09 22:28:41 +02:00
Daniel Marjamäki 8f84a493f4 remove foreach emulator 2018-04-09 22:09:10 +02:00
Matthias Krüger aed5cf3618 run dmake 2018-04-09 12:32:02 +02:00
Daniel Marjamäki 1537c7bda5 Makefile: set debug mode 2018-04-02 09:16:37 +02:00
Daniel Marjamäki af88d7c4a9 Makefile: updated for release 2018-04-02 09:02:50 +02:00
amai2012 b0b9df02e8 Update Makefile 2018-03-19 07:45:09 +01:00
Daniel Marjamäki 52fb9d3743 generate_cfg_tests: Added tool that generates test cases from cfg file 2018-03-18 12:50:55 +01:00
versat 65a19e7802 run dmake: enables platform file validation with 'make checkcfg' 2018-02-16 08:15:28 +01:00
amai 0f00259a96 Validate platform files 2018-02-15 20:35:12 +01:00
versat 7029b620d5 run dmake 2018-02-15 09:02:09 +01:00
Matthias Krüger b71c945ac4 fix build (CFG_DIR => CFGDIR) and run dmake. 2018-02-09 17:44:26 +01:00
versat 8e6ac60797 run dmake 2018-02-09 13:53:26 +01:00
Matthias Krüger 7a13e88170 run dmake 2018-02-05 20:28:33 +01:00
Daniel Marjamäki f027dff5ca Restore Makefile 2018-01-14 16:36:28 +01:00
Daniel Marjamäki 23b253e9eb 1.82: Update Makefile 2018-01-14 16:35:05 +01:00
Daniel Marjamäki 62dd357213 Makefile: Restore debug mode 2018-01-14 16:30:21 +01:00
Daniel Marjamäki 157f382a10 1.82: Updated Makefile
[ci skip]
2018-01-14 16:26:15 +01:00
orbitcowboy b72fb2a036 Attempt to fix broken travis build. 2017-10-15 08:42:51 +02:00
Daniel Marjamäki 0103a75b05 Makefile: Restore debug mode after release 2017-10-07 23:15:41 +02:00
Daniel Marjamäki fd229a20de 1.81: Updated Makefile 2017-10-07 12:56:29 +02:00
hexcoder 051a18b120 pull request for ticket 8180 (better diagnostic output for bailouts) (#964)
* sync build instructions from readme.txt

* refactored the patch from ticket 8180. Moved logic from macros to the bailoutInternal function

* adapt to new bailout message format

* adapt to new bailout message format

* adapt to new bailout message format

* compile fix for Microsoft platform

* remove directory part from file locations in bailout message (normalize)

* remove directory part from valueflow message filter

* adapt tests to file format without directory part

* adapt tests to file format without directory part

* new line number agnostic assert_equals methods

* new line number agnostic assert_equals methods

* adapt to new method assertEqualsWithoutLineNumbers()

* adapt to new method assertEqualsWithoutLineNumbers()

* Bugfix: do not replace line number with spaces, remove it

* review changes: const char * -> std::string, size_t -> int, std::to_string() -> MathLib::toString()

* set #line at the beginning to guard against insertions from match compiler

* Bugfix: counting lines can be difficult :-) #line 1 -> #line 2

* added method stripDirectoryPart()

* added method stripDirectoryPart()

* used new method Path::stripDirectoryPart()

* new dependency path.h in lib/valueFlow.cpp

* code cleanup, removing redundant temporary objects and casts
2017-10-05 23:03:13 +02:00
Daniel Marjamäki 64ce252f19 update Makefile 2017-09-30 12:42:41 +02:00
Matthias Krüger 05e986117f Run dmake.
This should fix Travis.
2017-08-30 06:59:41 +02:00
amai 74d9883260 Use shorter rules for linking the executables 2017-08-22 23:01:18 +02:00
Daniel Marjamäki b1b82319b1 Updated Makefile 2017-08-21 13:19:44 +02:00
Daniel Marjamäki 064f772639 Makefile: Set debug mode 2017-07-29 16:22:20 +02:00
Daniel Marjamäki 9c6332ea7b Makefile: Set release mode 2017-07-29 13:25:47 +02:00
orbitcowboy 7c5d14bf66 Updated dmake: activated validateCFG when 'make checkcfg' is called. 2017-07-29 12:42:43 +02:00
Matthias Krüger 159e420146 dmake: fix SRCDIR=build build.
The problem was hardcoded "lib" path which needs to be $(SRCDIR)
2017-06-21 17:59:00 +02:00
Daniel Marjamäki 2665e6e60c Fix dmake, it now depends on simplecpp::simplifyPath 2017-06-21 15:29:00 +02:00
Ivan Ryabov 170cfc24a2 Make detection of clang++ compiler more robust (#915)
* Make detection of clang++ compiler more robust
* Updated makefile generator
2017-06-16 12:56:29 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Matthias Krüger 3930f2d6bc try to fix "make" target (was broken due to missing comment-char). 2017-05-24 00:25:14 +02:00
amai cea82c4ee9 Add validateCFG target to validate library files against RNG 2017-05-24 00:07:59 +02:00
Daniel Marjamäki 41aa6dfb90 Updated Makefile 2017-05-23 15:57:25 +02:00
amai d88745805f Update Makefile 2017-05-20 23:00:36 +02:00
amai 8fa4a92ce1 Make tags target phony. Add entry to gitignore 2017-05-20 22:27:49 +02:00
Matthias Krüger aa3f1db33c Add internal check that checks for redundant non-nullness checks in Token::(simple)Match checks.
In code like
if (tok && Token::simpleMatch(tok, "bla")) {}
or
if (tok->previous() && Token::Match(tok->previous(), "foo")) {},
the first check is redundant because Token::(simple)Match already checks if the argument token is null.
2017-05-18 22:12:33 +02:00
Daniel Marjamäki 8d75d1b920 Partial fix for #8028 (ValueFlow: Origin/callstack of value) 2017-05-15 20:05:11 +02:00
Daniel Marjamäki 1f4dc201a9 Makefile: set debug mode 2017-05-13 11:40:03 +02:00
Daniel Marjamäki f769a65cdf 1.79: Update Makefile 2017-05-13 11:27:11 +02:00
Matthias Krüger 0090cd9ce5 run dmake 2017-05-11 19:01:41 +02:00
Daniel Marjamäki f2719ec6ca Refactoring CheckString::sprintfOverlappingData. Use AST, isSameExpression(), getArguments(), .. 2017-04-23 10:51:31 +02:00
Matthias Krüger d2b85316e6 run dmake 2017-04-23 10:40:26 +02:00
Daniel Marjamäki a14c82ec54 updated Makefile 2017-04-20 20:37:18 +02:00
Matthias Krüger c883f850f5 run dmake 2017-04-01 19:28:06 +02:00
Daniel Marjamäki 1faca91c1d Added 'endsWith' utility function. This will make compiling the democlient easier. 2017-04-01 18:14:18 +02:00
Daniel Marjamäki 4bf439936c Makefile: Set debug mode 2017-04-01 11:06:22 +02:00
Daniel Marjamäki e0d225325b 1.78: Updated Makefile 2017-04-01 11:05:13 +02:00
Matthias Krüger 6a718baae5 run dmake 2017-03-05 09:08:16 +01:00
Matthias Krüger 1e5e32c4a2 testrunner: remove non-gcc-style output format 2017-02-26 21:39:06 +01:00
Daniel Marjamäki a21af406cb Makefile: set debug mode 2016-12-31 19:03:52 +01:00
Daniel Marjamäki b3b4406482 1.77: update Makefile 2016-12-31 18:37:23 +01:00
Daniel Marjamäki 7b22ed276e Auto generate Makefile with dmake 2016-12-08 23:39:29 +01:00
Daniel Marjamäki b607e83648 Try to fix travis 2016-11-05 21:45:31 +01:00
Frank Zingsheim d4f01583b6 Fixed TODO (check if function parameter is non-const reference etc..) by common function 2016-11-01 14:06:30 +01:00
Daniel Marjamäki 853ea69629 run dmake 2016-10-29 12:38:10 +02:00
Daniel Marjamäki 9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
Matthias Krüger 5189dec343 run dmake 2016-10-02 16:20:48 +02:00
Daniel Marjamäki fff8aa8590 dmake: pathmatch was moved from cli to lib 2016-10-02 13:32:39 +02:00
Daniel Marjamäki e8b6235e23 dmake: pathmatch was moved from cli to lib 2016-10-02 13:15:51 +02:00
Daniel Marjamäki 3605457cbe CLI: Fix exclude of absolute path. #4399 2016-10-02 12:38:44 +02:00
Daniel Marjamäki 0126421711 Makefile: Run dmake 2016-08-20 13:22:46 +02:00
Matthias Krüger 032d2e5cd1 CXXFLAGS: remove -Winline (ticket #7693)
The debug build (with -Winline) has no optimizations and when setting optimizations for a release builds, CXXFLAGS are overridden.
So we either do a non-optimized debug build (where no inlining takes place which makes -Winline redundant) or do a release build without -Warning flags which means we would never see -O2 and -Winline together.
2016-08-19 11:19:15 +02:00
Matthias Krüger e5ee61aed7 run dmake 2016-08-19 11:13:56 +02:00
Daniel Marjamäki 606e31602c Fixed #7177 (Support compile_commands.json) 2016-08-13 10:50:03 +02:00