Commit Graph

19577 Commits

Author SHA1 Message Date
Armin Müller f4b5b156d7 Typos found by running "codespell" (#1715) 2019-03-01 01:01:39 +01:00
orbitcowboy 910adb0076 wxwidgets.cfg: Added support for more interfaces. 2019-02-28 23:46:17 +01:00
orbitcowboy fa59cb91cb gnu.cfg: Added <use-retval/> to xrealloc() configuration. 2019-02-28 23:45:51 +01:00
orbitcowboy c0bec7ef69 wxwidgets.cfg: Added support for wxDC::DrawEllipse(). 2019-02-28 23:21:46 +01:00
orbitcowboy f70e01b2b1 std.cfg: Added (experimental) support for MIN/MAX-macros. In case it turnes out this causes unexpected side effects, they can be easily removed. 2019-02-28 23:03:38 +01:00
orbitcowboy b222ff14be gnu.cfg: Added support fo xexit(). 2019-02-28 22:55:17 +01:00
orbitcowboy 80e31755da gnu.cfg: Added support for xrealloc(). 2019-02-28 22:48:39 +01:00
orbitcowboy 43daaca19c gnu.cfg: Added support for xstrdup(). 2019-02-28 22:46:16 +01:00
orbitcowboy 2a8f42d0f4 donate-cpu.py: Also extract 'h++'-files. 2019-02-28 22:41:21 +01:00
orbitcowboy fa55899ff3 Merge branch 'master' of https://github.com/danmar/cppcheck 2019-02-28 22:37:16 +01:00
orbitcowboy e6d36913c8 gnu.cfg: Added support for xmalloc() and xcalloc(). Reference: https://gcc.gnu.org/onlinedocs/libiberty/Functions.html 2019-02-28 22:36:52 +01:00
PKEuS 8af3708aa3 Optimization: Library does not need to store "#define " substring for each define 2019-02-28 22:34:26 +01:00
Andreas Rönnquist be6cec5ad8 Fix link to cppcheck wiki in man page (#1714) 2019-02-28 20:37:49 +01:00
Daniel Marjamäki 5563fef7bb Fixed #9008 (new crash in clang test suite) 2019-02-28 20:34:07 +01:00
Sebastian 71b1b2dd76
std.cfg: Add support for std::vector::assign(). (#1713)
Reference:
https://en.cppreference.com/w/cpp/container/vector/assign
2019-02-28 18:43:54 +01:00
Daniel Marjamäki 4f5a426fe5 Improved isVariableChangedByFunctionCall, better logic when parameter might be passed by reference 2019-02-28 17:02:46 +01:00
versat 7ccf4b9a0d qt.cfg: Add support for some QTimer functions.
Reference:
https://doc.qt.io/qt-5/qtimer.html
2019-02-28 16:07:11 +01:00
Daniel Marjamäki 494dd2ba3a Revert "Improved isVariableChangedByFunctionCall, better logic when parameter might be passed by reference"
This reverts commit 14a0031e88.
2019-02-28 15:56:25 +01:00
versat f6c3749015 gtk.cfg: Add support for g_alloca() and g_newa().
References:
https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-alloca
https://github.com/GNOME/glib/blob/master/glib/galloca.h
2019-02-28 15:29:37 +01:00
versat e64fc279f0 donate-cpu-server.py: Format total times like the package times.
Without formatting it could happen sometimes that the time is printed
like this: 245.099999999, now only one digit after the decimal point
is shown.
2019-02-28 13:46:40 +01:00
Sebastian c10ddaef4a
donate-cpu-server.py: Replace syntax that is deprecated in Python 3. (#1712)
The function `iteritems()` of `dict`s is deprecated. The recommended
alternative is to use `items()`, this function also works with Python 2.

The next issue is that lambdas can no longer unpack tuple parameters
in Python 3. It would be possible to use some workaround and still use
a lambda, but using `operator.itemgetter(1)` instead is faster and the
recommended method in such a case.

The syntax is now compatible with Python 2 and 3 but the server script
still does not work with Python 3. For example `socket.recv()` returns
`bytes` in Python 3 and `str` in Python 2. Currently `str` is expected
so it does not work with Python 3.
2019-02-28 13:34:23 +01:00
Daniel Marjamäki 14a0031e88 Improved isVariableChangedByFunctionCall, better logic when parameter might be passed by reference 2019-02-28 10:26:47 +01:00
Daniel Marjamäki 857681a049 Make quick fix for uninitialized variable false positive. Will look more at this soon. 2019-02-28 09:52:52 +01:00
Sebastian 4e90922e5b Donate CPU: Also use and accept .tar.bz2 package files. (#1707)
In my tests there were about 1500 additional packages
available as bz2 on the server.
For some packages a newer version is now used if it is
only available as .tar.bz2 archive.
The donate-cpu.py client is tested to work with .tar.bz2
files under Python 2.7.15 and 3.6.8.
2019-02-28 08:40:07 +01:00
IOBYTE 98bf112352 template simplifier: fix recursive variable templates (#1711) 2019-02-28 08:30:04 +01:00
Sebastian c8a7a4c653
library.cpp: WarnInfo: Fix crash (#1697)
If no 'alternatives' argument was specified and the `<warn/>` element
did not contain any text Cppcheck crashed because of a null pointer
access.
If there is no 'reason' and no 'alternatives argument and also no text loadFunction() returns with an error.
2019-02-28 06:19:42 +01:00
PKEuS 11daabc1a8 Set version to 1.87.99/1.88 dev 2019-02-27 21:30:54 +01:00
Sebastian 8c32cfe853
donate-cpu.py: Fix crash during decoding under Python 3. (#1710)
Python 3 directly decodes the text when it is read(). If there is any
invalid UTF-8 character in the text an exception is thrown (IIRC it is
UnicodeDecodeError). Opening the file with `error='ignore'` avoids
throwing an exception and just ignores the invalid character. Since
this is only possible since Python version 3 there must be extra code
for older versions.
The test script has been enhanced. It now also uses a package which
contains a file with at least one invalid UTF-8 character.
2019-02-27 20:01:38 +01:00
Daniel Marjamäki e27a7a585f Fix uninitvar false positive when taking address of variable 2019-02-27 18:44:30 +01:00
Daniel Marjamäki 80143725dd Fixed #8999 (False positive uninitvar related to casting) 2019-02-27 17:58:25 +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
Thomas Niederberger 084c7c284e Add missing Qt macros (#1709)
Add two Qt macros that were missing
2019-02-27 15:11:34 +01:00
Sebastian 117eed2255
donate-cpu.py: Also extract .qml files. (#1708)
.qml files are used when the Qt library is loaded.
2019-02-27 14:59:19 +01:00
Sebastian 2a45d390f3
gtk.cfg: Add support for gtk_label_new(), enhance gtk_label_get(). (#1706)
References:
https://developer.gnome.org/gtk3/stable/GtkLabel.html#gtk-label-new
https://developer.gnome.org/gtk2/stable/GtkLabel.html#gtk-label-get
Found by daca@home.
2019-02-27 12:56:21 +01:00
Daniel Marjamäki 226f0c7544 Fixed ValueType for auto variable 2019-02-27 10:28:18 +01:00
Paul Fultz II 032020c40d Fix issue 9001: FP: Found suspicious operator ',' [constStatement] 2019-02-27 07:09:22 +01:00
IOBYTE 9d75b718d3 template simplifier: remove use of simplifyTokenList2 in tests (#1705) 2019-02-27 07:06:34 +01:00
Paul Fultz II e846312fed Check subtraction of pointers to different objects 2019-02-27 06:55:48 +01:00
rikardfalkeborn 0e988cc755 Fix #8992: Add originalTypeToken to auto (#1701) 2019-02-27 06:44:31 +01:00
rikardfalkeborn c9efc26578 valueflow: Mark getLifetimeToken() static (#1703)
Fixes a compiler warning about missing declaration.
2019-02-26 23:35:11 +01:00
Daniel Marjamäki c44e2ed378 sizeof: write inconclusive warning if calculation in sizeof is done indirectly by macro 2019-02-26 21:06:44 +01:00
Daniel Marjamäki b248075aae Comment bailout
[ci skip]
2019-02-26 19:28:11 +01:00
Daniel Marjamäki 9e93e89a4d UninitVar: Fix false positives when there is possible cast 2019-02-26 19:26:46 +01:00
Sebastian 13b37631a6
std.cfg: Add support for std::vector::swap() and std::swap() (#1700)
References:
https://en.cppreference.com/w/cpp/container/vector/swap
https://en.cppreference.com/w/cpp/algorithm/swap
2019-02-26 18:21:17 +01:00
Kamil Dudka 21c22d0d4d TestNullPointer: add regression test to cover #8813 (#1699)
... which is fixed since 1.86-72-gbc34f0239
2019-02-26 17:14:45 +01:00
Sebastian d7e219043a
Library configuration validation: Enhance relaxng file (arg elements) (#1698)
Make sure that the elements of function->arg contain no duplicates.
Except for 'minsize' which can be specified zero to many times.
2019-02-26 14:00:54 +01:00
Sebastian 61f911d39a
qt.cfg: Add Q_DECLARE_TR_FUNCTIONS() and others (#1677)
Add unknownMacro Q_DECLARE_TR_FUNCTIONS found via daca@home.
Add function QCoreApplication::translate() and macro
QT_DECLARE_DEPRECATED_TR_FUNCTIONS() the unknownMacro depends on.
Reference:
https://doc.qt.io/qt-5/qcoreapplication.html#Q_DECLARE_TR_FUNCTIONS
https://doc.qt.io/qt-5/qcoreapplication.html#translate
2019-02-26 13:39:37 +01:00
IOBYTE bf85767829 template simplifier: make sure all instantiations are found and expan… (#1696)
* template simplifier: make sure all instantiations are found and expanded in #5097

* template simplifier: check output on another test

* template simplifier: add output to another test
2019-02-26 06:41:04 +01:00
IOBYTE 3f257d6310 template simplifier: instantiate template class when something inside… (#1695)
* template simplifier: instantiate template class when something inside class instantiated.

* template simplifier: add output to another test that now works
2019-02-25 21:01:34 +01:00