Commit Graph

57 Commits

Author SHA1 Message Date
chrchr-github cd21918520
Fix FP memleak with outparam allocation (f'up to #12186) (#5677)
I wonder if it is worth trying to get this right. We also have FPs when
the return value is assigned to a variable, and that seems much harder
to fix.
2023-11-19 19:51:32 +01:00
chrchr-github 3e47acd580
Fix FP memleak (f'up to #12186) (#5671) 2023-11-16 18:35:32 +01:00
chrchr-github 63a5a71c20
Fix #12186 FN memleak with outparam allocation (#5661) 2023-11-16 15:23:40 +01:00
chrchr-github 73251544a4
Fix #11842 FN constParameterPointer with library function (#5257) 2023-08-05 18:48:43 +02:00
chrchr-github 78182d4773
Fix FN constVariablePointer (#5076)
* Fix FN constVariablePointer

* Fix FP

* Add const

* Fix tests

* Add const
2023-05-22 19:53:51 +02:00
Oliver Stöneberg 30131837b5
refs #11603 - deprecated `--enable=information` implicitly enabling `missingInclude` (#4865) 2023-03-09 20:04:20 +01:00
Oliver Stöneberg 514e605598
CI-unixish.yml: fixed and enabled all `build` steps for macos (#4832) 2023-03-02 20:54:30 +01:00
Oliver Stöneberg da09a92b0a
test/cfg: enabled `information` and `--inconclusive` in all cases / some cleanups (#4784) 2023-02-24 21:37:56 +01:00
Oliver Stöneberg fd15811215
de-coupled `--check-library` from `information` severity and other dependencies (#3861) 2023-01-26 22:28:04 +01:00
orbitcowboy ccbc6a3b72 gnu.cfg: Added support for gethostbyname_r() and gethostbyname2_r() 2022-12-22 09:47:19 +01:00
orbitcowboy 3576f0a0c7 gnu.cfg: Added support for gethostbyaddr_r() 2022-12-22 09:36:53 +01:00
orbitcowboy 7df6ba419e gnu.cfg: Added nullPointer tests for getop_long_only() 2022-12-22 09:13:18 +01:00
orbitcowboy 521f0ce720 gnu.cfg: Added nullpointer tests for getopt_long(). 2022-12-21 17:06:08 +01:00
orbitcowboy 4de443957c gnu.cfg: Added support for error() function. And a TODO testcase for ticket #11197. 2022-07-17 14:43:52 +02:00
orbitcowboy 7c816425b9 gnu.cfg: Fixed compiler warning from GCC: warning: ‘struct servent’ declared inside parameter list will not be visible 2022-05-04 20:29:12 +02:00
orbitcowboy e293b66ac6 gnu.cfg: Added support for getservent_r(). 2022-05-03 11:54:28 +02:00
orbitcowboy 6ad5a94acf gnu.cfg: Improved configuration for memrchr(). 2022-05-01 18:10:19 +02:00
orbitcowboy e0ccfea027 gnu.cfg: Improved configuration of ffsl() and ffsll() 2022-05-01 15:29:35 +02:00
orbitcowboy 85f44d36dd gnu.cfg: Added support for semtimedop(). 2022-05-01 11:41:51 +02:00
orbitcowboy 7c766a9696 gnu.cfg: Ensure a nullPointer warning is shown for invalid input to mempcpy() and wmempcpy(). 2022-04-21 09:19:32 +02:00
orbitcowboy d376201cb4 gnu.cfg: Added support for getpw(). Ref.: https://man7.org/linux/man-pages/man3/getpw.3.html 2022-03-23 17:14:26 +01:00
Daniel Marjamäki 7fefdf2bf7 astyle formatting 2021-05-03 16:34:55 +02:00
keinflue f47fd20e14
Add test cases and improvements for PR #3240. (#3242) 2021-05-03 10:45:37 +02:00
Dmitry-Me 8af2ee968e Fix incorrect usage of "unlikely" hint 2019-11-27 18:08:10 +03:00
Dmitry-Me 45e617f50b Fix -Wint-conversion warning 2019-11-27 18:08:10 +03:00
Sebastian 02c0240dcd
Fix #9322: bsd.cfg, gnu.cfg: Fix FP for mmap when argument "fd" is -1 (#2306)
In contrast to POSIX, GNU and BSD allow or even require the argument
"fd" to be set to -1 if MAP_ANONYMOUS or MAP_ANON is specified.
2019-10-30 09:39:50 +01:00
Sebastian 60de5e12dd gnu.cfg: Add configuration for __alignof__() (#2268)
Reference: https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Alignment.html
2019-10-14 20:59:38 +02:00
Sebastian 0527b80174
gnu.cfg: Add support for __glibc_likely() and __glibc_unlikely() (#2267)
Reference:
https://sourceware.org/glibc/wiki/Style_and_Conventions#Branch_Prediction
2019-10-14 12:16:28 +02:00
versat 77c711d129 gnu.cfg: Add configuration and test for __builtin_assume_aligned() 2019-10-10 10:23:21 +02:00
versat 7277fe5a2b gnu.cfg: Add support for macro __extension__
The macro does nothing except preventing from warnings when compiling
with "pedantic" or other options.
2019-09-19 12:27:21 +02:00
orbitcowboy da29a1f56b gnu/bsd.cfg: Cleanup redundant configuration for timercmp() and add more tests. 2019-09-10 11:51:47 +02:00
versat 7737a448cf Fix #9345 FP wrongPrintfScanfArgNum for vasprintf
Configuration "<formatstr/>" for function is wrong, for the argument it
is fine.
2019-09-09 15:02:55 +02:00
orbitcowboy aed5e17867 #9323, #9331: Moved configuration and tests to gnu and bsd. 2019-09-08 19:17:15 +02:00
versat 2519a1aed5 gnu.cfg: Add more __builtin_* functions and some tests
Most of them were detected by daca@home
2019-08-02 12:27:46 +02:00
Sebastian 5390588cda
gnu.cfg: Add xfree() (#2051)
It is hard to find good references, one that describes it a bit can
be found here:
https://manpages.ubuntu.com/manpages/bionic/man3/xmalloc.3pub.html

xfree() can be used instead of free().
A check, to verify that a memory leak is found if the memory allocated
via xmalloc() is not freed, has also been added.
2019-08-02 07:41:32 +02:00
Rikard Falkeborn e19068504d Configure xrealloc and adjust gnu memory functions (#2003)
Remove <noreturn> tag, since the functions do not return unless there
was no error.
2019-07-16 08:12:21 +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
Daniel Marjamäki e80181d35a astyle formatting
[ci skip]
2019-05-17 09:32:14 +02:00
orbitcowboy e48d785ea4 gnu.cfg: Added tests for mkostemp(), mkstemps() and mkostemps() functions. The test script 'test/cfg/runtests.sh' is now loading posix.cfg when checking gnu.cfg. Otherwise 'close()' was not available to Cppcheck, which lead to an error when 'make checkcfg' was executed. 2019-05-16 17:49:33 +02:00
versat 7c09b0cfe0 gnu.cfg: Add "buffer-size" attribute and tests for xcalloc(). 2019-03-21 10:44:18 +01:00
versat 9b6b94336c gnu.cfg: Add buffer-size to xmalloc; add some __builtin_*() functions. 2019-03-19 15:24:02 +01:00
Daniel Marjamäki 34a8b2b519 Quick fix for 'make checkcfg' 2019-03-16 18:17:16 +01:00
versat 3d02c10fde gnu.cfg: Further fixes, enhancements and adding argument directions. 2019-03-14 09:26:27 +01:00
Martin Ettl fe402498e1 qt.cfg: Added support for Q_DECLARE_PUBLIC()-macro. 2019-02-27 15:38:31 +01:00
Martin Ettl 17c1733b0e gnu.cfg: Added support for asprintf() and vasprintf(). There is a FN with memory leak detection regarding pointer args, which is already mentioned in #8980. A comment has been added. 2019-02-27 15:17:34 +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
amai 3032ac4619 Fix compile error in test code 2018-10-28 21:36:28 +01:00
orbitcowboy b998dcb5aa gnu.cfg: Added support for '__builtin_memset'. 2018-10-27 18:25:05 +02:00
amai 5c0fd0d5b4 Skip some test on cygwin since interface is not available 2018-09-29 16:49:12 +02:00
orbitcowboy 879803c90f gnu.cfg: Fixed FP (nullpointer) when third parameter of epoll_ctl is set to NULL. 2018-09-25 09:07:49 +02:00