Commit Graph

26099 Commits

Author SHA1 Message Date
chrchr-github b80d06b69e
Don't warn for 'x | MACRO' when MACRO is 0 (#4176) 2022-06-07 21:13:31 +02:00
Daniel Marjamäki 359f6b3680 misra: enable more checks for misra c++ 2008 checking 2022-06-07 20:55:55 +02:00
Daniel Marjamäki ec13f5fe5c misra: When checking C++ code only activate certain misra c++ compliant rules. It will be supported to run the addon on C++ code. 2022-06-06 22:22:52 +02:00
chrchr-github 52453947c8
Don't warn for 'x | 0' in macro (#4172)
* Fix #11082 FN badBitmaskCheck for binary or with 0

* Add test for #10703

* Don't warn for 'x | 0' in macro

* Add test for #10876
2022-06-06 11:17:36 +02:00
Oliver Stöneberg 9c2585866c
.clang-tidy: disabled `boost-*` and `darwin-*` and enabled `modernize-use-equals-delete` checks (#4173)
* enabled `modernize-use-equals-delete` clang-tidy warnings

* .clang-tidy: disabled `boost-*` and `darwin-*` clang-tidy checks
2022-06-06 11:17:20 +02:00
Daniel Marjamäki 4f75361eaa remove one more sonarcloud file 2022-06-05 21:40:37 +02:00
Daniel Marjamäki 858b64332e remove sonarcloud again 2022-06-05 21:40:10 +02:00
orbitcowboy 326d340d76 Added a regression test; A real-world test case like this was found by daca@home: ftp://ftp.de.debian.org/debian/pool/main/o/ogdi-dfsg/ogdi-dfsg_4.1.0+ds.orig.tar.gz head ogdi-ogdi_4_1_0/ogdi/c-api/ecsinfo.c:637:26: error: Invalid strcspn() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr]. 2022-06-04 19:33:56 +02:00
Daniel Marjamäki d595c1e6e8 Add sonarcloud action 2022-06-04 18:02:17 +02:00
chrchr-github f962436826
Fix #11082 FN badBitmaskCheck for binary or with 0 (#4170)
* Fix #11082 FN badBitmaskCheck for binary or with 0

* Add test for #10703
2022-06-04 17:25:10 +02:00
Oliver Stöneberg 412054e83a
enabled and mitigated `misc-unused-using-decls` clang-tidy warnings (#3543) 2022-06-04 16:39:25 +02:00
orbitcowboy 433ce58fe6 Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/libs/libslirp/libslirp_4.7.0.orig.tar.bz2; head libslirp-v4.7.0/src/tftp.c:336:20: error: Invalid strcasecmp() argument nr 1. A nul-terminated string is required. [invalidFunctionArgStr] 2022-06-04 12:00:54 +02:00
orbitcowboy 3b133176ed windows.cfg: Added some missing <strz/>-flags 2022-06-04 07:52:31 +02:00
orbitcowboy 1c1c72058f Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/libs/libslirp/libslirp_4.7.0.orig.tar.bz2; head libslirp-v4.7.0/src/tftp.c:336:20: error: Invalid strcasecmp() argument nr 1. A nul-terminated string is required. [invalidFunctionArgStr] 2022-06-04 07:46:28 +02:00
Oliver Stöneberg 9e8d5d1b2e
avoid unnecessary `validateCFG-*` targets in CMake (#4166) 2022-06-03 23:07:28 +02:00
orbitcowboy ee072b11cd posix.cfg: Added some missing <strz/> and <minsize>-flags 2022-06-03 21:36:01 +02:00
Oliver Stöneberg cfab6aeecf
use CMake for sanitizer builds / some CMake command cleanups (#4147) 2022-06-03 21:33:56 +02:00
Oliver Stöneberg ce945ec7fc
enabled and fixed `modernize-use-override` clang-tidy warnings (#4168) 2022-06-03 21:32:39 +02:00
orbitcowboy eae164371c std.cfg: Added some missing <strz/>-flags 2022-06-03 21:24:20 +02:00
orbitcowboy 1e3efc1bdf std.cfg: Added some missing <strz/>-flags 2022-06-03 21:20:52 +02:00
chrchr-github e6f2929fac
Fix #11085 FN constVariable with range-based for (#4118) 2022-06-03 19:24:59 +02:00
Oliver Stöneberg cc08a661e6
astutils.h: reserve `std::vector` space in `visitAstNodes()` to avoid excess allocations (#4158) 2022-06-03 19:21:17 +02:00
orbitcowboy 00abf21d40 Format 2022-06-03 18:59:43 +02:00
orbitcowboy a74bb485b0 Fixed TODO_ASSERT 2022-06-03 18:59:09 +02:00
orbitcowboy 6680bf9790 Fixed TODO_ASSERT 2022-06-03 18:35:11 +02:00
Oliver Stöneberg d36e05af28
enabled and fixed `modernize-use-emplace` clang-tidy warnings (#4165)
* enabled and fixed `modernize-use-emplace` clang-tidy warnings

* avoid unnecessary creation of temporaries in `emplace_back()` calls
2022-06-03 15:09:29 +02:00
chrchr-github 111f4e17da
Fix #11117 FP nullPointerArithmetic when adding 0 (#4167) 2022-06-03 13:11:54 +02:00
orbitcowboy 1a4bd0a7b3 Fixed FP, found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/k/knot/knot_3.1.8.orig.tar.xz; knot-3.1.8/tests/knot/test_confio.c:301:18: error: Invalid strcmp() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr] 2022-06-03 13:10:45 +02:00
orbitcowboy 7dac213734 Removed useless parentheses 2022-06-03 10:50:07 +02:00
orbitcowboy 9b0f41e1a0 Revert change 3dfe9eff3e (commitcomment-75236431). 2022-06-03 10:22:29 +02:00
orbitcowboy 345411a68c Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/i/imx-usb-loader/imx-usb-loader_0~git20200517.30b43d69.orig.tar.gz; imx_usb_loader/imx_loader_config.c:130:16: error: Invalid strncat() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr] 2022-06-03 10:20:19 +02:00
orbitcowboy a59e510cdc Fixed FP - invalidFunctionArgStr, found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/i/ion/ion_3.2.1+dfsg.orig.tar.gz; ion-open-source/arch-rtems/pmqlsi.c:146:18: error: Invalid mq_send() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr] 2022-06-03 10:06:32 +02:00
orbitcowboy 8382ea7692 std.cfg: Improved configuration of strpbrk() and added regression tests. These cases were found in the wild (daca@home: ftp://ftp.de.debian.org/debian/pool/main/i/ion/ion_3.2.1+dfsg.orig.tar.gz, ion-open-source/contrib/dtnperf/dtnperf/src/utils.c:71:32: error: Invalid strpbrk() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr]). 2022-06-03 08:36:25 +02:00
orbitcowboy c24edc528e astutils.cpp: Removed useless parentheses 2022-06-03 00:18:35 +02:00
orbitcowboy 3dfe9eff3e astutils.cpp: Improved const correctness 2022-06-03 00:07:15 +02:00
orbitcowboy 4e9565b4e6 Fixed FP invalidFunctionArgStr, found a daca@home: ftp://ftp.de.debian.org/debian/pool/main/h/haskell-hs-bibutils/haskell-hs-bibutils_6.10.0.0.orig.tar.gz 2022-06-02 23:39:04 +02:00
Paul Fultz II 72342de0da
Fix 11114: FP knownConditionTrueFalse across functions (#4163)
* Fix 11114: FP knownConditionTrueFalse across functions

* Format
2022-06-02 23:24:11 +02:00
Oliver Stöneberg 133b9c2790
some `test/CMakeLists.txt` cleanups (#4067)
* test/CMakeLists.txt: removed unnecessary `CTest` include - gets rid of additional CTest/CDash targets

* test/CMakeLists.txt: adjusted CMake version - `CMAKE_MATCH_<n>` requires 3.9`

* test/CMakeLists.txt: sorted `add_cfg()` calls

* test/CMakeLists.txt: extract test fixtures based on `REGISTER_TEST` macro

* test/CmakeLists.txt: added TODO
2022-06-02 22:26:01 +02:00
orbitcowboy 67795cdfcf
Fixed FPs from Ticket 11119 - invalidFunctionArgStr with null-terminated strings (#4164)
* Fixed first FP from #11119 - invalidFunctionArgStr with null-terminated strings

* Fixed second test case from #11119.

* Fixed another FP, found on daca@home ftp://ftp.de.debian.org/debian/pool/main/g/glhack/glhack_1.2.orig.tar.gz.

* Format
2022-06-02 19:30:29 +02:00
orbitcowboy 58460edaf8 Fixed crash due to missing null pointer check. 2022-06-02 11:32:55 +02:00
orbitcowboy 50c612b7d9 gnu.cfg: Added missing '<strz/>'-flags 2022-06-02 09:58:47 +02:00
orbitcowboy 0eae0023a3 posix.cfg: Added missing '<strz/>'-flags 2022-06-02 09:41:10 +02:00
orbitcowboy 63a8eac4d3 std.cfg: Added missing '<strz/>'-flags 2022-06-02 09:23:22 +02:00
orbitcowboy 7275350f3e Combined consecutive Token::simpleMatch() calls 2022-06-02 07:27:19 +02:00
orbitcowboy 3b2509c9cc Fixed failing self-check: style: Call to 'Token::previous()' followed by 'Token::tokAt()' can be simplified. [redundantNextPrevious] 2022-06-02 07:16:09 +02:00
orbitcowboy 886b5d1039 Improved invalidFunctionArgStr checking and detect more cases where a NON-null-terminated string is used to call functions, configured with <strz/>. 2022-06-02 01:09:09 +02:00
chrchr-github cd7362e0e7
Fix FN with default init (#4162)
* Fix #11099 FP: variableScope when using range constructor to vector

* Format

* Fix FN with default init
2022-06-01 23:18:59 +02:00
chrchr-github 2452a2c01d
Fix #11099 FP: variableScope when using range constructor to vector (#4161)
* Fix #11099 FP: variableScope when using range constructor to vector

* Format
2022-06-01 21:15:41 +02:00
orbitcowboy 204b91a295 Added 'Alon Alexander' to AUTHORS file because of it's contribution with ea3bb8b297 2022-06-01 15:48:47 +02:00
Alon Alexander ea3bb8b297
Ignore copy/move constructors for function naming checks (#4134)
* Ignore copy/move constructors for function naming checks

* Also change in namingng

* Add test in naming_test.cpp
2022-06-01 06:54:31 +02:00