cppcheck/test/cfg
Rikard Falkeborn 8cd1d5a47d Use library for memleak checks (#2002)
* Use library for memleak checks

Change memleakOnRealloc and leakReturnValNotUsed to use library
configuration instead of hardcoding "realloc".

In order to do so, some care needs to be taken when matching for a
reallocation function, since it can no longer be assumed that the input
to be allocated is the first argument of the function. This complicates
getReallocationType() and checkReallocUsage() but is necessary in order
to handle for example freopen() properly.

Also, refactor memleakOnRealloc check to reduce duplicated code when
checking "a" and "*a". When doing so, extending the check to look for
arbitrary number of "*" can be done for free (just change an if
statement to a while statement). Most likely, this is an unusual case in
real world code.

* Remove redundant whitespace in Token::Match()

* Run on simplified checks

* Fix cppcheck warning
2019-07-22 10:37:36 +02:00
..
boost.cpp boost.cfg: Add argument directions; some fixes; rearrange and document. 2019-03-15 11:13:08 +01:00
bsd.c Travis: Try to fix 'make checkcfg' 2019-03-02 19:38:11 +01:00
generate-cfg-tests.sh add script to generate cfg tests 2018-03-18 13:03:19 +01:00
gnu.c Configure xrealloc and adjust gnu memory functions (#2003) 2019-07-16 08:12:21 +02:00
gtk.c Use library for memleak checks (#2002) 2019-07-22 10:37:36 +02:00
openmp.c openmp.cfg: Add library configuration for OpenMP (#1956) 2019-07-05 03:00:52 +02:00
posix.c posix.cfg: Add `<use-retval/>` to pthread_mutex_trylock (#1959) 2019-07-07 12:57:02 +02:00
qt.cpp qt.cfg: Add Q_DECLARE_TR_FUNCTIONS() and others (#1677) 2019-02-26 13:39:37 +01:00
runtests.sh openmp.cfg: Add library configuration for OpenMP (#1956) 2019-07-05 03:00:52 +02:00
sqlite3.c Library: Add initial configuration with tests for SQLite3 library. (#1737) 2019-03-13 13:57:40 +01:00
std.c Use library for memleak checks (#2002) 2019-07-22 10:37:36 +02:00
std.cpp Library configuration: function argument direction fixes and enhancements (#1722) 2019-03-04 22:57:40 +01:00
unmatchedSuppressionTest.c unmatched suppression: fix test case 2019-01-22 18:47:52 +01:00
windows.cpp Fix #9047 (c-style casts before malloc) (#1930) 2019-07-03 08:39:44 +02:00
wxwidgets.cpp Refactoring of Null Pointer Checker 2019-03-16 21:21:30 +01:00