Commit Graph

1584 Commits

Author SHA1 Message Date
versat 7ee36489f1 gnu.cfg: Add configuration for __builtin_memcpy()
In case there is something like `#define memcpy __builtin_memcpy` in the
code our define for __builtin_memcpy does not work.
So the configuration for __builtin_memcpy is added as a fallback.
2019-08-02 13:17:39 +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
orbitcowboy c1773225e7 boost.cfg: Added support for some math macros 2019-08-02 12:01:52 +02:00
orbitcowboy 48b9d61d49 python.cfg: Added support for some macros found by daca@home. 2019-08-02 08:13:38 +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
versat 7965ac5858 gtk.cfg: Add/fix more function configurations
daca@home reported a missing noreturn configuration for most of these
functions.
2019-08-01 15:05:42 +02:00
versat 64b4ed5b13 gtk.cfg: Add/fix function configurations
daca@home reported a missing noreturn configuration for most of these
functions.
2019-08-01 13:44:53 +02:00
orbitcowboy 4704b1d331 gtk.cfg: Added support for more macros, found by daca@home. 2019-08-01 10:12:31 +02:00
versat 6995d40c14 qt.cfg: Add configuration for deprecated function QString::find() 2019-08-01 09:43:24 +02:00
Sebastian 549452b7b9
qt.cfg: Add container and function configurations for QVector (#2052)
Reference: https://doc.qt.io/qt-5/qvector.html
2019-07-31 13:58:55 +02:00
orbitcowboy a9bdf99e07 std.cfg: Added *experimental* support for math constants liken M_PI. These are *NOT* standard, but they are supported by GCC/Clang and VS. 2019-07-31 11:11:01 +02:00
orbitcowboy 2e11fbbfd6 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 15:11:50 +02:00
orbitcowboy c91b4e74e3 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 15:04:32 +02:00
orbitcowboy dd9bcd4d38 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 14:54:55 +02:00
orbitcowboy fc49099793 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 14:51:11 +02:00
orbitcowboy b3d4e14a39 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 14:47:32 +02:00
orbitcowboy 3d08b7fe98 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 14:43:02 +02:00
orbitcowboy bb7c8eebbc wxwidgets.cfg: Added support for more interfaces. 2019-07-30 09:44:33 +02:00
orbitcowboy 4fdbc6d172 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 09:39:52 +02:00
orbitcowboy f340d30d42 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 09:32:20 +02:00
orbitcowboy af86a58f5e wxwidgets.cfg: Added support for more interfaces. 2019-07-30 09:29:43 +02:00
orbitcowboy 290b4fb1d2 wxwidgets.cfg: Added support for more interfaces. 2019-07-30 09:23:22 +02:00
orbitcowboy ba97e3844f wxwidgets.cfg: Added support for more interfaces. 2019-07-29 19:24:15 +02:00
Sebastian 4e6a228b97
qt.cfg: Add obsolete functions qStableSort() and qSwap() (#2050) 2019-07-29 18:58:31 +02:00
Sebastian 2a3567cb44
std.cfg: Add std::string::copy() and std::wstring::copy() (#2041)
Reference:
https://en.cppreference.com/w/cpp/string/basic_string/copy
http://www.cplusplus.com/reference/string/string/copy/
2019-07-29 18:57:50 +02:00
Sebastian cce061fe95
qt.cfg: Add functions of class QDomElement (#2049)
Most were found by daca@home
2019-07-29 16:57:16 +02:00
ChristophStrehle f7f60a8da6 Variable number of arguments for boost test suite macros (#2043)
The macros defined in unit_test_suite.hpp have a variable
number of arguments if BOOST_PP_VARIADICS is defined.

See:
https://github.com/boostorg/test/blob/develop/include/boost/test/unit_test_suite.hpp
2019-07-28 09:23:27 +02:00
versat 22f8080d1d qt.cfg: Add some functions of class QLabel 2019-07-26 15:59:47 +02:00
versat cdb0e8322c qt.cfg: Add qSort() and some functions of class QAction 2019-07-26 14:56:32 +02:00
versat 1f71fe15d6 opengl.cfg: Add functions glGetString() and glGetStringi() 2019-07-26 09:04:01 +02:00
Sebastian dcc2599121
std.cfg: Add `<pure/>` to std::min() and std::max() (#2037) 2019-07-26 07:51:26 +02:00
Sebastian 2d5f3ae3b4
std.cfg: Add std::next() and std::prev() (#2022)
Reference:
https://en.cppreference.com/w/cpp/iterator/next
https://en.cppreference.com/w/cpp/iterator/prev
2019-07-25 12:40:15 +02:00
orbitcowboy b3e9724c06 wxwidgets.cfg: Added support for more interfaces. 2019-07-25 10:07:17 +02:00
orbitcowboy 9ea75bc7fe wxwidgets.cfg: missing const-flag 2019-07-25 09:47:27 +02:00
orbitcowboy 46072f7ed5 windows.cfg: Added support for FindResource(). 2019-07-25 09:46:40 +02:00
orbitcowboy 8ca54d9d2b wxwidgets.cfg: Added support for wxPGProperty::GetCellRenderer(). 2019-07-25 09:46:10 +02:00
versat f29e88a8a5 opengl.cfg: Add glLoadMatrix() and glUseProgram() 2019-07-24 15:19:52 +02:00
Daniel Marjamäki 2da75d5af4 Split up Cppcheck attribute. low and high values can be specified separately and they can be used for variables also. 2019-07-24 15:08:26 +02:00
versat 0041733bd6 opengl.cfg: Add more function configurations.
Some were reported by daca@home
2019-07-24 14:48:09 +02:00
Sebastian d185607122
std.cfg: Fix function configuration for std::back_inserter (#2023)
Reference: https://en.cppreference.com/w/cpp/iterator/back_inserter
2019-07-24 12:44:56 +02:00
orbitcowboy 2be981d68d wxwidgets.cfg: Remove wrong '<pure/>-tag. 2019-07-24 11:43:21 +02:00
orbitcowboy 377f6f29b5 wxwidgets.cfg: Added support for more functions from wxGCDC. 2019-07-24 11:33:02 +02:00
orbitcowboy 4fc15b3eb2 wxwidgets.cfg: Added support for more functions from wxGrid. 2019-07-24 11:30:35 +02:00
orbitcowboy 39bbe03974 wxwidgets.cfg: Added support for wxImage::AddHandler(). 2019-07-24 11:24:36 +02:00
orbitcowboy c2cf7b3f03 wxwidgets.cfg: Added support for members of wxLayoutAlgorithm-class. 2019-07-24 11:09:54 +02:00
orbitcowboy 3c1041a091 wxwidgets.cfg: Added support for wxDC::DrawEllipticArc(). 2019-07-24 11:00:55 +02:00
orbitcowboy b912c56fa0 wxwidgets.cfg: Added support for wxDC::DrawSpline(). 2019-07-24 10:54:19 +02:00
Sebastian 3e5f07b3fb
qt.cfg: Add/enhance functions of class QString (#2027)
Some were reported missing by daca@home.
2019-07-23 19:55:55 +02:00
Sebastian 4986b02566
qt.cfg: Add functions of class QRegExp (#2017)
This class is also used by the Cppcheck GUI.
Reference: https://doc.qt.io/qt-5/qregexp.html
2019-07-22 12:53:58 +02:00
amai2012 2915376c4f Remove attribute use-retval from std::rotate 2019-07-19 20:33:15 +02:00
Sebastian f50cd2330c
std.cfg: Add some more std::<container>::swap() functions (#2018) 2019-07-19 10:00:14 +02:00
Sebastian 9c8c539549
qt.cfg: Add some functions of class QXmlStreamAttributes (#2016)
This class is also used by the Cppcheck GUI.
2019-07-18 12:38:42 +02:00
Sebastian 512c1b12c6
qt.cfg: Add some functions of class QXmlStreamWriter (#2010)
This class is also used by the Cppcheck GUI.
2019-07-18 06:30:53 +02:00
Sebastian a997a30824
cppcheck-lib.cfg: Enhance Cppcheck library configuration (#2009) 2019-07-17 20:05:13 +02:00
Daniel Marjamäki 7b48fb6b32 Revert "cfg: Add python macros to fix daca crashes"
This reverts commit 760586dd0a.
2019-07-16 16:52:48 +02:00
orbitcowboy d17ab72e3c wxwidgets.cfg: Added support for wxGrid::XYToCell(). 2019-07-16 16:49:42 +02:00
versat ab227cbf6e sqlite3.cfg: Add more functions reported as missing by daca@home 2019-07-16 16:21:05 +02:00
versat 8e00f4ddfb sqlite3.cfg: Add some functions reported as missing by daca@home 2019-07-16 14:59:33 +02:00
Sebastian 820ffdeee8
gtk.cfg: Add some macros and functions reported as missing by daca@home (#2005) 2019-07-16 13:42:01 +02:00
orbitcowboy 2ae5ac7dc2 windows.cfg: Removed TEXT()-macro since it is handled internally. 2019-07-16 13:40:41 +02:00
Daniel Marjamäki 760586dd0a cfg: Add python macros to fix daca crashes 2019-07-16 13:30:59 +02:00
orbitcowboy 1f7fdb229a windows.cfg: Added support for GetFullPathName(). Reference: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamea 2019-07-16 13:23:39 +02:00
orbitcowboy f2e70f9236 wxwidgets.cfg: Added support for wxFile::ReadAll(). 2019-07-16 13:14:20 +02:00
orbitcowboy 29983aac0c windows.cfg: Added support for more platform types and some macros defined in winnt.h 2019-07-16 13:10:04 +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
amai2012 63fa4afa7a GetModuleFileName might be useful w/o return code 2019-07-16 06:07:31 +02:00
Rikard Falkeborn dcc375ca64 Update gtk memory functions (#2000)
* Improve configuration of g_try_realloc and g_try_realloc_n
* Mark g_realloc and similar functions as realloc functions
* Remove g_new, g_new0, etc as <alloc> functions, these are defined as
  macros and handled as the functions they're expanded to.
* Add tests. TODO tests will be resolved by using the library
  configuration in the checker.
2019-07-15 14:51:58 +02:00
Sebastian b242817565
qt.cfg: Add functions of class QMap (#1985)
Reference:
https://doc.qt.io/qt-5/qmap.html
2019-07-12 18:06:05 +02:00
versat f47fc84825 opengl.cfg: Add glColor* functions 2019-07-12 14:34:15 +02:00
versat aaecd300de gtk.cfg: Add some gtk_widget_* functions
Found by daca@home (checkLibraryNoReturn)
2019-07-12 13:58:39 +02:00
versat f7e1a12c6f gtk.cfg: Fix g_object_new configuration, argument 2 can be NULL
It is valid to use NULL as second argument and thus do not specify any
properties for this object.
2019-07-12 12:37:02 +02:00
versat 2f1d828b0c gtk.cfg: Add more g_object_* functions
Found by daca@home
2019-07-12 12:10:45 +02:00
Daniel Marjamäki 68cc7516a1 Annotations: Add annotation __cppcheck_in_range__(low,high) 2019-07-12 11:09:54 +02:00
versat d223d73cdb opengl.cfg: Add glTexCoord* functions 2019-07-12 09:42:40 +02:00
orbitcowboy d81aa4caf8 windows.cfg: Added support for GetModuleFileName(). 2019-07-12 09:11:31 +02:00
versat a67abb5fa2 opengl.cfg: Add glNormal3* functions
Found by daca@home
2019-07-12 08:44:23 +02:00
versat d4d9bb4830 qt.cfg: Add some global Qt functions
Found by daca@home
2019-07-11 16:20:22 +02:00
Daniel Marjamäki 783f7f1648 Rename safeValues to unknownValues 2019-07-11 16:05:48 +02:00
versat 30f49b2fbd qt.cfg: Add functions of classes QTest and QHash
References:
https://doc.qt.io/qt-5/qtest.html
https://doc.qt.io/qt-5/qhash.html

Most of the functions were found missing by daca@home.
2019-07-11 15:32:48 +02:00
versat d880830efc qt.cfg: Add functions of QPainter class
Reference:
https://doc.qt.io/qt-5/qpainter.html

Most of the function configurations were found missing by daca@home
2019-07-11 14:53:38 +02:00
Sebastian f239d4675b
gtk.cfg: Add g_object_set() (#1981)
Reference:
https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-set
2019-07-11 13:13:08 +02:00
Sebastian a4bcb7e0fb
qt.cfg: Add functions of class QDate (#1979)
Reference:
https://doc.qt.io/qt-5/qdate.html

Found by daca@home
2019-07-11 09:47:33 +02:00
Sebastian e49b098a86
std.cfg: Add mem_fn() (#1976)
std.cfg: Add mem_fn()

Reference:
https://en.cppreference.com/w/cpp/utility/functional/mem_fn
2019-07-11 08:26:24 +02:00
Daniel Marjamäki 05d35b063d Function return: Extra check of safe function return values 2019-07-10 20:00:21 +02:00
Sebastian 1cb90f925e
gtk.cfg: Add gtk_box_new(), gtk_hbox_new() and gtk_vbox_new() (#1975)
References:
https://developer.gnome.org/gtk3/stable/GtkBox.html#gtk-box-new
https://developer.gnome.org/gtk3/stable/GtkHBox.html#gtk-hbox-new
https://developer.gnome.org/gtk3/stable/GtkVBox.html#gtk-vbox-new

Found by daca@home
2019-07-10 11:28:54 +02:00
IOBYTE a05dfc9150 fix daca codeblocks crash (#1968)
* fix daca codeblocks crash

* fix the cause of the missing scope
2019-07-09 16:04:22 +02:00
Sebastian b2c747cff6
qt.cfg: Add "addWidget()" for classes Q(V|H|)BoxLayout and QGridLayout. (#1972)
Found by daca@home
2019-07-09 12:38:41 +02:00
Sebastian db43dcd601
posix.cfg: Add `<use-retval/>` to pthread_mutex_trylock (#1959)
Ignoring the return value of pthread_mutex_trylock is always a bug.
There is no other way to check if the mutex is locked or not after the
call.
2019-07-07 12:57:02 +02:00
Sebastian a9a70f25ad
sqlite3.cfg: Add more function configurations (#1957)
Some were found missing by daca@home
2019-07-05 15:45:21 +02:00
Rikard Falkeborn 839fcddd8a Fix #6115 (Add support to realloc to cfg files) (#1953)
* Allow to configure realloc like functions

* memleakonrealloc: Bring back tests.

The old memleak checker was removed, and the tests for it was removed in
commit 9765a2dfab. This also removed the
tests for memleakOnRealloc. Bring back those tests, somewhat modified
since the checker no longer checks for memory leaks.

* Add realloc to mem leak check

* Add tests of realloc buffer size

* Configure realloc functions

* Add test of freopen

* Allow to configure which element is realloc argument

* Fix wrong close in test

cppcheck now warns for this

* Update manual

* Update docs

* Rename alloc/dalloc/realloc functions

Naming the member function realloc caused problems on appveyor. Rename
the alloc and dealloc functions as well for consistency.

* Change comparisson order

* Remove variable and use function call directly

* Create temporary variable to simplify

* Throw mismatchError on mismatching allocation/reallocation

* Refactor to separate function

* Fix potential nullptr dereference

As pointed out by cppcheck.
2019-07-05 12:44:52 +02:00
orbitcowboy afce191db1 wxwidgets.cfg: Simplified macro 2019-07-05 11:06:29 +02:00
orbitcowboy df16e69725 wxwidgets.cfg: Added support for more macros from wx/event.h 2019-07-05 11:03:41 +02:00
orbitcowboy 6588c90b26 wxwidgets.cfg: Added support for more macros from wx/event.h 2019-07-05 11:00:59 +02:00
orbitcowboy 26038244a3 wxwidgets.cfg: Added support for more macros from wx/event.h 2019-07-05 10:54:46 +02:00
Sebastian c45dff1e1d
openmp.cfg: Add library configuration for OpenMP (#1956)
See https://www.openmp.org/
2019-07-05 03:00:52 +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
Sebastian 6ba3b2703a
posix.cfg: Add setsockopt() and getsockopt() (#1944)
Found by daca@home
2019-07-02 15:14:31 +02:00
Rikard Falkeborn b530b3dfff Remove <noreturn> from g_malloc and friends (#1942)
From the Gnome Developer documentation
(https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html):

    If any call to allocate memory using functions g_new(), g_new0(),
    g_renew(), g_malloc(), g_malloc0(), g_malloc0_n(), g_realloc(), and
    g_realloc_n() fails, the application is terminated. This also means
    that there is no need to check if the call succeeded. On the other
    hand, g_try_...() family of functions returns NULL on failure that
    can be used as a check for unsuccessful memory allocation. The
    application is not terminated in this case.

g_new(), g_new0() and g_renew() are defines using g_malloc(),
g_malloc0() and g_realloc() respectively, so there is no need to change
those.
2019-07-02 11:51:28 +02:00
orbitcowboy cca1a6aa2e wxwidgets.cfg: Added support for more interfaces. 2019-07-02 08:48:32 +02:00
orbitcowboy 78bf217354 windows.cfg: Added support for more contants. Reference: https://docs.microsoft.com/de-de/windows/win32/api/minwinbase/ns-minwinbase-debug_event 2019-07-02 08:43:10 +02:00