Commit Graph

61 Commits

Author SHA1 Message Date
Daniel Marjamäki 112852f70b formatting 2022-08-24 08:53:59 +02:00
chrchr-github afef71f6b6
Partial fix for #10057 unused variable without assignment not detected (#4348)
* Partial fix for #10057 unused variable without assignment not detected

* Add test for #9672
2022-08-13 08:29:06 +02:00
orbitcowboy 1934386738 windows.cfg: deprecate '_alloca()'. Ref. https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170 2022-07-29 21:41:32 +02:00
orbitcowboy 558e00272d windows.cfg: Improved configuration of _mbscmp() and _mbscmp_l(). 2022-05-27 12:28:30 +02:00
Paul Fultz II 4c1aeb0cb1
Remove old pointer alias check (#3983) 2022-04-07 11:36:15 +02:00
orbitcowboy d131235a53 test windows.cfg: Added regression test for _wtoi_l and _atoi_l. 2022-02-15 11:37:10 +01:00
chrchr-github cd7532df21
Fix #7709 FN C-style pointer casting with built-in or typedef types /… (#3814) 2022-02-10 20:48:51 +01:00
chrchr-github 966dbb1990
Windows.cfg: add UNREFERENCED_PARAMETER() macro (#3809) 2022-02-08 11:50:28 +01:00
orbitcowboy 2dea968ec5 windows.cfg: Improved configuration of _fseeki64() 2022-02-07 09:12:31 +01:00
Paul Fultz II abb0563cef
Fix 10726: Crash in CheckExceptionSafety::checkRethrowCopy (#3711) 2022-01-16 12:35:51 +01:00
Armin Müller d5daba331f
Typos found by running "codespell" (#3659) 2022-01-02 08:12:08 +01:00
orbitcowboy 21abf315b3 windows.cfg: Added a regression test for GetPrivateProfileString() as we had a FP in the past 8b6c14aa48 2021-10-17 11:05:19 +02:00
Daniel Marjamäki b3f9df968b Uninitvar: fixed 'make checkcfg' 2021-10-03 20:32:39 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
orbitcowboy 7ad64891ea Added tests for overlapping data. 2021-07-10 18:28:26 +02:00
orbitcowboy b68c5dee07 windows.cfg: Added support for _mbscpy(). 2021-07-10 09:27:22 +02:00
Daniel Marjamäki 22ae4543a6 Fixed 'make checkcfg' 2021-05-22 07:39:27 +02:00
Daniel Marjamäki 6a0a2456b5 make checkcfg; temporarily disable suppressions 2021-05-16 22:48:22 +02:00
Daniel Marjamäki 45eb9f82a0 Fix CI; Cppcheck find some more unusedAllocatedMemory violations in test/cfg/.. 2021-05-13 23:08:58 +02:00
Daniel Marjamäki de2e836727 test/cfg/windows.cpp; Uncommented TODO, Cppcheck now writes a warning as it should about unused function return value 2021-04-05 05:20:42 +02:00
orbitcowboy b33326bf51 windows.cfg: Added a regression test for GetSystemInfo that ensure no uninitvar-FP is shown. 2020-06-26 20:45:18 +02:00
orbitcowboy 24d6794ba6 windows.cfg: Added support for more interfaces. 2019-10-21 10:09:20 +02:00
Sebastian e3fe559f0d
windows.cfg: Add support for `__alignof()` (#2271)
Reference:
https://docs.microsoft.com/en-us/cpp/cpp/alignof-operator?view=vs-2019
2019-10-15 16:02:28 +02:00
versat d08539fe17 windows.cfg: Fix PostMessage() configuration
First argument is optional (allowed to be NULL). See also the annotation
"_In_opt_".
Reference:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postmessagea
2019-09-18 09:22:57 +02:00
Sebastian 5bf6bd1f5e
windows.cfg: Enhance/fix Windows configuration (#2177)
Add/fix some missing/incorrect function configurations found by
analyzing TortoiseGit project.
Add some macros.
2019-09-18 08:41:37 +02:00
Rikard Falkeborn 60a213e6a5 Fix #9047 (c-style casts before malloc) (#1930)
* Fix #9047 (c-style casts before malloc)

Note that there are still no warnings for c++-style casts

* Fix memleak check with casts of assignments in if-statements

* Fix possible null pointer dereference

As pointed out by cppcheck.

* Add check of astOperand2 when removing casts

This is similar to how it is done in other checks.
2019-07-03 08:39:44 +02:00
orbitcowboy 9bfe7d74c0 windows.cfg: Fixed FP for invalidFunctionArg in second argument of _getcwd(). Reference: https://docs.microsoft.com/en-us/previous-versions/sf98bd4y(v%3Dvs.140) 2019-03-25 09:07:02 +01:00
versat 0d14bdac22 windows.cfg: Add "buffer-size" attributes, fix allocation configuration.
Memory allocated with `_aligned_*malloc*()` must be freed with
`_aligned_free*()`. Using `free()` is illegal.
See
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-malloc
for details.
Also add tests for some of the changed functions.
2019-03-22 13:11:03 +01:00
Daniel Marjamäki 34a8b2b519 Quick fix for 'make checkcfg' 2019-03-16 18:17:16 +01:00
Daniel Marjamäki cdeb91bfcc Travis: Restore the uint8_t arrays 2019-03-13 18:59:55 +01:00
Daniel Marjamäki f9ce5b3407 Travis: quick fix for 'make checkcfg' 2019-03-13 09:30:59 +01:00
Daniel Marjamäki 5087f15035 Travis: Try to fix 'make checkcfg' 2019-03-02 19:38:11 +01:00
orbitcowboy 360823203f windows.cfg: Ensure the return value is taken into account for memory (re)-allocation functions. 2019-03-01 08:58:53 +01:00
Sebastian b1f68229f2
Library cfg tests: Enable all tests again, exclude regressions for now (#1626)
Use `--check-library` for all tests as it was done before.
Re-enable all tests in runtests.sh again.
The regressions where runtests.sh would fail are disabled via "FIXME"
comment in the inline suppression comment.
2019-01-25 17:03:16 +01:00
amai2012 97bf5de133 Add more Windows (Microsoft) macros and a few lines of related test code 2019-01-08 21:15:04 +01:00
Daniel Marjamäki 0b4e08cac9 Use FwdAnalysis in UnusedVar. This is still work-in-progress. Merging to master branch so it can be tested. 2018-12-13 18:52:56 +01:00
Daniel Marjamäki b7ca9bdc8d Travis: redundantCopy is not detected at the moment 2018-11-24 12:01:10 +01:00
orbitcowboy d10788164a windows.cfg: Added support for _locale_t 2018-06-08 14:41:56 +02:00
orbitcowboy c56033f998 test/windows.cfg: Fixed wrong test case. 2018-06-08 14:33:37 +02:00
orbitcowboy 74b18d7fd9 windows.cfg: Added support for _strncpy_s_l(). 2018-06-04 16:58:09 +02:00
orbitcowboy 53c53db312 windows.cfg: Added support for _mbscat_s(). 2018-05-28 21:52:44 +02:00
orbitcowboy 75e28e46c5 windows.cfg: Added support for _mbscat(). 2018-05-28 10:08:11 +02:00
orbitcowboy 3407f3e932 windows.cfg: Added test cases for CreateThread(). 2018-05-25 11:50:12 +02:00
Sebastian 8b94bfaf0a
windows.cfg: Add macros SUCCEEDED() and FAILED(). (#1264)
Somehow the opposite inner condition is not detected when macros are used. I created this ticket: https://trac.cppcheck.net/ticket/8596
2018-05-24 14:52:32 +02:00
orbitcowboy 3311307227 windows.cfg: Added test cases for toupper/tolower functions. 2018-05-24 10:05:56 +02:00
Sebastian aa3722feea
windows.cfg: Add lstrlen() configuration and tests. (#1239)
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms647492(v=vs.85).aspx
2018-05-17 15:43:01 +02:00
Sebastian 3c5777fbc6
windows library: Add config for some Local* functions (#1139)
Add configuration and tests for LocalAlloc, LocalFree and some other
Local* functions.
LocalReAlloc is currently not configured as an alloc/dealloc function
(like realloc is not configured in std.cfg), i am not sure how to
correctly configure it.
2018-03-29 20:47:22 +02:00
Sebastian e38ec41ded
windows.cfg: Add some commonly used macros (#1127) 2018-03-22 08:31:50 +01:00
Sebastian 65c85cbb53
Windows library: Add intrinsics __noop and __nop (#1119) 2018-03-15 12:31:20 +01:00
Sebastian ed3cd2929e
Windows library: Enhance functions, add tests (#1117)
Enhance *Equal/*Compare/*Copy/*Move/*Zero/*Fill memory functions to
catch buffer access out of bounds errors and ignored return values.
Replaced some function configuration by according defines as it is done
in windows to avoid redundant (and error prone) configurations.
2018-03-14 15:01:37 +01:00