Commit Graph

11743 Commits

Author SHA1 Message Date
Daniel Marjamäki e4bea02cad Fixed #7578 (varid not set for 'pointer to array' member variable in method) 2020-04-15 20:56:21 +02:00
Daniel Marjamäki 266c8d2c09 Remove temporary daca bailouts 2020-04-15 19:54:56 +02:00
Daniel Marjamäki 98be091d80 Fixed typedef simplification for array of function pointers 2020-04-13 16:28:01 +02:00
Daniel Marjamäki 9ccf068393 astyle formatting
[ci skip]
2020-04-13 13:48:05 +02:00
Oliver Stöneberg 2c1e36e63e
cleaned up includes based on include-what-you-use (#2600)
* cleaned up includes based on include-what-you-use

* check.h: trying to work around Visual Studio 2012 bug

* fixed Visual Studio compilation
2020-04-13 13:44:48 +02:00
Daniel Marjamäki 0747bc7ba3 Clang import; Ensure Function::arg is set 2020-04-13 13:37:34 +02:00
Daniel Marjamäki e1543587e0 Clang import; Bailout if clang reports error message 2020-04-13 12:52:24 +02:00
Daniel Marjamäki 2f5e585e59 astyle formatting
[ci skip]
2020-04-13 12:52:00 +02:00
Daniel Marjamäki adb3588b24 Clang import; Set Variable::typeStartToken and Variable::typeEndToken 2020-04-13 10:45:31 +02:00
Daniel Marjamäki c99867421d Clang import; Fixed dead pointer 2020-04-12 22:41:45 +02:00
shaneasd 82c09f243b
Maybeunusedsupport (#2570)
* Add rudimentary support for [[maybe_unused]]

* Add more test cases. use the symboldatabase rather than reparsing. Fix travis error.

* test review actions

* change var to usage._var
2020-04-12 20:35:54 +02:00
Daniel Marjamäki 97f5c5767e Clang import; Ensure function pointer is created 2020-04-12 20:34:05 +02:00
Daniel Marjamäki 6b579293b6 Clang import; Destructor 2020-04-12 17:27:49 +02:00
Daniel Marjamäki 4dfb793cd2 Clang import; Improved handling of constructor 2020-04-12 17:27:49 +02:00
Daniel Marjamäki 97b04ba9a7 Syntax check: Using keyword in global scope 2020-04-11 17:36:22 +02:00
Paul Fultz II 8b27f1c216
Fix issue 9667: crash: crash in valueflow for weird code where label address is returned (#2602) 2020-04-11 13:56:53 +02:00
Daniel Marjamäki e8e3c2660d Detect syntax error 'x ==> y' 2020-04-11 11:05:27 +02:00
Daniel Marjamäki 32bf53eeda Fixed #9221 (False positive when using an array of lists) 2020-04-10 14:01:15 +02:00
Daniel Marjamäki eff225a09c Use 'static' instead of unnamed namespace for variables 2020-04-10 13:48:38 +02:00
Daniel Marjamäki b67a043e5b Remove unused variable 2020-04-10 13:16:15 +02:00
Daniel Marjamäki 05769e8dcc Code cleanup 2020-04-10 13:14:38 +02:00
Daniel Marjamäki c029d5150c Fixed #9123 (False positive: uninitialized variable) 2020-04-10 12:33:15 +02:00
Daniel Marjamäki 0725c2290c Tokenizer: Do not simplify function pointers to normal pointers as we loose important information 2020-04-10 11:53:32 +02:00
Daniel Marjamäki e0c8118c02 Fixed crash in AST 2020-04-09 17:42:51 +02:00
Daniel Marjamäki d7af52865d ValueFlow: avoid crash when && is used in r-value variable declaration 2020-04-09 14:38:10 +02:00
Daniel Marjamäki e7ddd9cc15 ForwardAnalyzer: Add recursion limit 10000 2020-04-09 12:11:33 +02:00
Oliver Stöneberg aaffd1f761
some cleanups (#2601)
* exclude the *_sanitized fuzz-client dependencies from all as well

* .gitignore: added CMake output folders and removed a duplicated entry
2020-04-09 09:23:31 +02:00
Daniel Marjamäki 8e9d7290b2 Tokenizer::simplifyTypedef: Better handling of r-value references 2020-04-08 22:40:45 +02:00
Achouv 7719e4309d
avoid false positive unused static const struct member (#2598) 2020-04-08 18:09:20 +02:00
Oliver Stöneberg e3b644d877
aligned GCC warnings (#2592)
* excluded oss-fuzz related CMake targets from all

* checkstl.cpp: fixed -Wmissing-declarations warning

* suppress -Wsuggest-attribute=format GCC warnings for tinyxml in CMake for now

* aligned GCC warnings in dmake, CMake and Travis / removed now useless WARNINGS_ANSI_ISO
2020-04-08 14:56:12 +02:00
Paul Fultz II 3773d0e875
Find more redundant conditions (#2597) 2020-04-07 07:15:15 +02:00
Daniel Marjamäki 66ee3a0afc Clang import: Better handling of methods that are defined after declaration 2020-04-06 17:18:52 +02:00
Daniel Marjamäki 8dd0a9241c TemplateSimplifier: Simplification of const types 2020-04-05 13:51:58 +02:00
Daniel Marjamäki 189cf29597 astyle formatting
[ci skip]
2020-04-05 10:57:51 +02:00
Sam Lane 60f9fefcd4
Add Support For Configuring Addon Python Interpreter Version (#2591) 2020-04-05 10:57:28 +02:00
Daniel Marjamäki f01783238e Fixed #9596 (False positive: Returning an integer in a function with a pointer return type auto handling) 2020-04-04 20:03:48 +02:00
orbitcowboy 048b08f5be Running astyle. There are no functional changes [ci skip] 2020-04-04 14:49:08 +02:00
Paul Fultz II efdc5f5c4e
Fix issue 9435: False negative: invalidContainer when using range for loop (#2587)
* Fix issue 9435: False negative: invalidContainer when using range for loop

* Use ast

* Make string const
2020-04-04 11:47:02 +02:00
Oliver Stöneberg 1dd8d4afaf
fixes for Clang and clang-tidy 10 (#2588)
* clang_tidy.cmake: added clang-tidy-10 to program list

* fixed -Wrange-loop-construct Clang warnings

* fixed readability-qualified-auto clang-tidy warnings

* .clang-tidy: actually disable clang-analyzer-* warnings

* .clang-tidy: disabled some new warnings introduced with clang-tidy-10
2020-04-04 11:44:59 +02:00
Daniel Marjamäki ac45bf7af2 Small refactoring 2020-04-04 11:19:39 +02:00
Paul Fultz II 40e1e82a65
Fix issue 9644: Token::astOperand1() cyclic dependency on valid C++ code (#2590)
* Remove check for lambda

* Add test case
2020-04-04 10:55:31 +02:00
Daniel Marjamäki e0acd1abf8 Tokenizer: Report unknown macro that contains '.x=..' argument 2020-04-04 10:32:56 +02:00
Daniel Marjamäki efb583e3d1 astyle formatting
[ci skip]
2020-04-04 10:31:38 +02:00
Paul Fultz II a22a77c1fc
Use library config for unstable containers instead of hardcoded values (#2585)
* Use library config for unstable containers instead of hardcoded values

* Fix xml validation
2020-04-03 13:16:57 +02:00
Paul Fultz II 58e3f19ed8
Fix issue 9662: AST broken, ternary operator missing operand(s) on valid C++ code (#2589)
* Fix issue 9662: AST broken, ternary operator missing operand(s) on valid C++ code

* Add test for issue 9537
2020-04-03 10:04:10 +02:00
Oliver Stöneberg 8968edeabd
avoid unnecessary creation of lists in SingleValueFlowForwardAnalyzer.isAlias() and MultiValueFlowForwardAnalyzer.isAlias() (#2586)
Comparing before and after (Ir per call) when scanning the Cppcheck source:
SingleValueFlowForwardAnalyzer.isAlias()
1246 -> 1101
MultiValueFlowForwardAnalyzer.isAlias()
4202 -> 1617
2020-04-03 09:25:21 +02:00
Paul Fultz II 71deaaeb18
Fix issue 9608: False Positive: returnDanglingLifetime with braced-init-list (#2583) 2020-04-02 10:17:58 +02:00
Paul Fultz II 02ae71917a
Fix issue 9536: False positive: Reference to temporary returned when using operator() (#2582)
* Fix issue 9536: False positive: Reference to temporary returned when using operator()

* Add more test cases
2020-04-01 22:35:41 +02:00
Paul Fultz II 6cc58e1086
Set a max for the combination of arguments that can be passsed through valueFlowSubFunction (#2579)
* Set a max for the combination of arguments that can be passsed

* Skip mismatch path ids when computing the cross product
2020-04-01 22:33:09 +02:00
Armin Müller 3ff171e157
Typos found by running "codespell" (#2584) 2020-04-01 14:37:43 +02:00