Commit Graph

24730 Commits

Author SHA1 Message Date
Georgiy Komarov a2cb9f17c1
misra: Don't consider variadic arguments as the violation of rule 2.7 (#3315)
The MISRA 2012 standard does not say anything about variadic functions
in the definition of rule 2.7. Therefore, these cases should be
considered as false positives.
2021-06-29 08:46:35 +02:00
Daniel Marjamäki 2bc87d13e1 Bump simplecpp 2021-06-28 19:47:37 +02:00
Daniel Marjamäki 33fb855ff9 win_installer; Add dpdk.cfg to installation 2021-06-28 17:40:26 +02:00
PJ Aitken 7944ea9937
Initial support for DPDK functions (#3313) 2021-06-28 17:38:44 +02:00
Georgiy Komarov 62dbe2eb2f
misra: Fix false positives for rule 8.2 (#3311)
Reported in the forum: https://sourceforge.net/p/cppcheck/discussion/development/thread/801dc07e59/?page=1&limit=25#a1a8
2021-06-27 22:57:50 +02:00
Georgiy Komarov 6432922c76
misra: Fix crash on rule 8.2 (#3310)
The example code that reproduces this crash:

```
int misra_8_2_o(
    const uint32_t a1,
    const uint8_t *const a2
)
{ return *a2 + a1; }
int misra_8_2_p(
    const uint32_t a1,
    const uint8_t *const a2
);
```

The unit test was not added because it looks like a typo and regressions
are unlikely.
2021-06-27 22:57:37 +02:00
Georgiy Komarov b89f5fbeff
misra: Fix 8.2 false positives (#3309)
* misra: Fix 8.2 false positives

Fix false positives in rule 8.2 that occurred in cases when we have a
function definition and declaration in the same file.

For example, the following code generated false positives before this
commit:

```
void f(uint8_t * const x);
void f(uint8_t * const x)
{ (void)x; }
```

We need to distinguish the declaration and the definition, so the dump
file generation routine was extended to keep token where the definition
of the function. The analysis in the addon also been improved.

Closes Trac issue: https://trac.cppcheck.net/ticket/10219
2021-06-27 10:51:32 +02:00
Daniel Marjamäki 05df31c12a Fixed unit tests 2021-06-27 09:04:47 +02:00
Daniel Marjamäki 2a2e071a85 Tokenizer::simplifyAttribute; Set function attribute for function pointer 2021-06-26 14:23:39 +02:00
Paul Fultz II 66956ed959
Fix 10323: Wrong known value. x!=0 does not mean that x==1 (#3308) 2021-06-26 09:16:45 +02:00
Paul Fultz II 508188df2b
Fix 10297: Regression; ValueFlow known value, sign conversion (#3307) 2021-06-26 09:16:04 +02:00
Daniel Marjamäki bf019a1ab2 Run dmake 2021-06-25 16:44:41 +02:00
Daniel Marjamäki 9769afe434 knownConditionTrueFalse; avoid several warnings when nonzero expression is compared to see if it is positive or negative 2021-06-25 16:25:25 +02:00
Georgiy Komarov 452c92494e
misra: Fix 8.2 false positives (#3306)
Type declaration on the next line is not allowed in rule 8.2. But we
need to make sure that the files of the checked files are the same.

Reported on the forum: https://sourceforge.net/p/cppcheck/discussion/development/thread/801dc07e59/#32c3/e90b/293e/39df/85b3/b821/e0c3
2021-06-25 16:06:29 +02:00
Daniel Marjamäki a45e0776f2 windows installer; Add vcl.cfg 2021-06-25 09:15:26 +02:00
orbitcowboy 3ed042fcfc wxwidgets.cfg: Added support for more interfaces 2021-06-25 08:01:00 +02:00
Daniel Marjamäki 2f7f43e1f2 astyle formatting 2021-06-24 23:19:59 +02:00
chrchr-github 39f9bc7422
Fix #10304: std::distance() returns std::ptrdiff_t (#3297) 2021-06-24 23:19:29 +02:00
Daniel Marjamäki 769b20b426 ValueFlow: Clarify note when impossible value is assigned (#10297) 2021-06-24 17:10:06 +02:00
Georgiy Komarov 79f59d8f39
misra: Fixed crash with struct fields with unknown types on 9.x rules (#3305)
This fixes the crash on with struct fields containing unknown types
reported on the forum:
https://sourceforge.net/p/cppcheck/discussion/general/thread/d64551cc55/#5f0f

The suggested patch doesn't handle the cases when there are struct
fields with arrays containing unknown types. So the addon will not
generate warnings in these cases. The problem is that Cppcheck doesn't
generate valueType-pointer information for unknown types in the dump
file. When adding this in symboldatabase.cpp, MISRA addon will generate
a lot of false positives because we depend on the null value of
valueType.

So I suppose it better to left this as is, to don't break the addon for
such rare cases.
2021-06-24 08:29:27 +02:00
Paul Fultz II b13e44fce5
Fix 10309 and 10034: internalAstError with init lists (#3303) 2021-06-24 08:25:13 +02:00
Paul Fultz II 6e74fc64b9
Fix 10317: Regression: internalAstError on valid C++ code (#3302) 2021-06-24 08:22:03 +02:00
Ivar Andreas Bonsaksen dc582560cc
Add default parameter to next() to prevent StopIteration exception when no corresponding rawToken is found for '[' token (#3301)
Co-authored-by: Ivar Bonsaksen <ivar.bonsaksen@microchip.com>
2021-06-19 20:24:21 +02:00
Daniel Marjamäki 2c8c8a5fa6 Readd cppcheck-errors.rng 2021-06-19 19:44:36 +02:00
Daniel Marjamäki 2d08564c8a astyle formatting 2021-06-19 14:47:35 +02:00
Paul Fultz II dd178c3ad9
Fix 10314: Possible nullPointerRedundantCheck false positive (#3298) 2021-06-19 13:59:48 +02:00
Paul Fultz II 5922d5178b
Fix 10321: Two flags confuse null pointer check (#3300) 2021-06-19 13:58:57 +02:00
Paul Fultz II eb7b225fc1
Fix 10119: ValueFlow; object member is not uninitialized. happens when there is static member also. (#3299) 2021-06-19 13:58:18 +02:00
Daniel Marjamäki a7707a457d astyle formatting 2021-06-14 07:39:41 +02:00
Daniel Marjamäki c27c513b60 Run dmake 2021-06-14 07:39:23 +02:00
shane a5664c3e49 allow token iteration in range for 2021-06-14 07:39:01 +02:00
Daniel Marjamäki 08626b9815 GUI: Set Settings::libraries properly before analysis 2021-06-13 19:48:45 +02:00
Daniel Marjamäki 03445c01c1 Fix false positives when class might inherit from VCL TObject class 2021-06-13 18:56:04 +02:00
Maksim Derbasov 5dae162780
[triage tool] Keep UI alive while wget and tar execution (#3296) 2021-06-13 10:51:42 +02:00
Daniel Marjamäki 071309d4a1 travis; skip juliet check it fails very often 2021-06-12 19:36:36 +02:00
Daniel Marjamäki 7dbca470f7 Suppressions; Fixed problem with cppcheck build dir is used 2021-06-12 18:19:00 +02:00
Daniel Marjamäki 118ad67645 testrunner: return value in non-void functions 2021-06-12 16:43:48 +02:00
Daniel Marjamäki 83d406806f CI; Fixed problems in windows paths 2021-06-12 12:45:31 +02:00
Daniel Marjamäki 4a4808e0ff ImportProject; Try to use relative paths 2021-06-12 11:10:35 +02:00
Daniel Marjamäki ed05a5c3b3 astyle formatting 2021-06-12 11:09:15 +02:00
Georgiy Komarov b74618d989
gui: Handle errors in creating build directory (#3295)
If user doesn't create a build directory, it is not possible to run the
addons, because addons are trying to check dump files in non-existent
build directory.
2021-06-09 11:21:23 +02:00
Georgiy Komarov fc6558c22b
gui: Set the correct names for coding standards in UI elements. NFC. (#3294)
Names of MISRA and CERT should be written is uppercase, because they are
abbrevations.
2021-06-09 11:20:51 +02:00
Paul Fultz II f55a4563f9
Fix 10308: danglingTemporaryLifetime confused by function parameter (#3292) 2021-06-09 09:21:03 +02:00
Paul Fultz II f3a33ea330
Fix 10294: ValueFlow: Wrong <Uninit> value below loop (#3291) 2021-06-09 09:20:43 +02:00
orbitcowboy 1e78b30958 wxwidgets.cfg: Do not simplify WX_DECLARE_OBJARRAY into std::vector, its causing FPs 2021-06-07 11:44:41 +02:00
orbitcowboy 1cd2e2f6ba wxwidgets.cfg: Added support for more interfaces 2021-06-07 11:39:57 +02:00
orbitcowboy e82736cc0c wxwidgets.cfg: Added support for more interfaces 2021-06-07 10:37:46 +02:00
orbitcowboy 377167a70f wxwidgets.cfg: Added support for more interfaces 2021-06-07 10:31:48 +02:00
Daniel Marjamäki 3c3435dd10 Fix bug in Tokenizer::simplifyVarDecl 2021-06-06 08:13:40 +02:00
orbitcowboy 3c458d8b7b wxwidgets.cfg: Added support for 'wxWindowBase::PrepareDC' 2021-06-05 08:57:54 +02:00