versat
4dae640e8c
gtk.cfg: Add type conversion macros
...
Reference:
https://developer.gnome.org/glib/stable/glib-Type-Conversion-Macros.html
daca@home found that they are missing.
2019-02-15 08:44:21 +01:00
versat
ed25ae3acb
gtk.cfg: Add some configurations often reported as missing by daca@home
...
Add two g_assert*(), g_signal_connect_data(), some g_signal_connect*() functions and macros and g_strdup_printf().
2019-02-13 15:35:46 +01:00
versat
fe6ea282d3
qt.cfg: Add support for QT_TR_NOOP* and QT_TRANSLATE_NOOP* macros
...
Reference:
https://doc.qt.io/qt-5/i18n-source-translation.html#using-qt-tr-noop-and-qt-translate-noop-in-c
2019-02-12 10:21:56 +01:00
versat
8207e48adc
qt.cfg: Add support for macros Q_LIKELY and Q_UNLIKELY
...
Reference:
https://doc.qt.io/qt-5/qtglobal.html#Q_LIKELY
https://doc.qt.io/qt-5/qtglobal.html#Q_UNLIKELY
2019-02-12 08:21:49 +01:00
Sebastian
2c1f97d787
qt.cfg: Add support for macros `forever` and `Q_FOREVER` ( #1662 )
...
Reference:
https://doc.qt.io/qt-5/qtglobal.html#forever
https://doc.qt.io/qt-5/qtglobal.html#Q_FOREVER
2019-02-11 16:35:01 +01:00
Sebastian
3427e61383
std.cfg: Add support for std::string::assign() ( #1660 )
...
Reference: https://en.cppreference.com/w/cpp/string/basic_string/assign
2019-02-11 13:40:36 +01:00
Sebastian
5fe7aad5e3
qt.cfg: Add configuration and tests for macro Q_NULLPTR ( #1651 )
...
Qt defines `Q_NULLPTR` with `nullptr` if it is available, otherwise with `NULL`.
Since there seems to be no (sane) way to configure it the same way in the library configuration it is just defined with `NULL`.
2019-02-07 12:27:25 +01:00
Sebastian
55ce6d2073
qt.cfg: Add support and tests for QFile::exists function ( #1645 )
...
Found by daca@home
2019-02-06 13:23:05 +01:00
versat
62b9368b3c
gtk.cfg: Add configurations for g_free() and g_malloc() / g_malloc0()
...
Reference: https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html
daca@home found these missing function configurations among others.
Also add tests for g_malloc() and g_free().
2019-01-28 13:47:46 +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
Sebastian
ce96ffd433
gtk.cfg: Add internationalization macros / functions ( #1623 )
...
Found via Donate CPU / daca@home.
Reference: https://developer.gnome.org/glib/stable/glib-I18N.html
Update header comment in gtk.cfg since it is now only edited manually.
2019-01-25 13:07:48 +01:00
Daniel Marjamäki
c773e6ed10
runtests.sh: uncomment the xmlstarlet checking
2019-01-23 09:40:43 +01:00
Daniel Marjamäki
87489c3ffd
Try to make Travis happy
2019-01-22 18:56:12 +01:00
Daniel Marjamäki
f03ce97aae
unmatched suppression: fix test case
2019-01-22 18:47:52 +01:00
versat
6f62b83fe6
checkcfg: Add regression test for umatchedSuppression errors
...
As discussed in https://trac.cppcheck.net/ticket/8931 a regression test is added
to the test/cfg/runtests.sh script to make sure that unmatchedSuppression messages result in an Cppcheck exit code that signals a failure.
2019-01-21 20:53:13 +01:00
Sebastian
aa40e374ac
test/cfg/runtests.sh: Qt test: Fix syntax check when "-fPIC" is required ( #1600 )
...
On linux systems (like travis) Qt often seems to be built with the option "reduce_relocations" which requires an application using it to specify the option "-fPIC".
2019-01-14 17:48:04 +01:00
amai2012
2adf65968b
posix.cfg: improve configuration for dlsym()
2019-01-12 21:50:02 +01:00
amai2012
400c6c8e76
Improve configuration for dlopen and add suitable test
2019-01-10 21:14:37 +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
Sebastian
0aa4910244
Boost configuration: Add macros and initial test file ( #1575 )
2019-01-08 20:30:21 +01:00
Sebastian
7a59949cb4
qt config test: Use pkg-config to retrieve Qt settings. ( #1571 )
...
To be able to use real Qt-Code in "test/cfg/qt.cpp" and still do a
syntax check the Qt settings are read out via pkg-config now if it is
available. This way the test now can contain Qt macros and functions and
the syntax check can still be used.
Additionally the same options as for the other tests are used now for
the Qt config tests.
Installing the package "qtbase5-dev" should be enough to enable the
syntax checks (already installed for travis tests).
2019-01-07 14:40:21 +01:00
orbitcowboy
611eb81302
Fixed checkcfg: test/cfg/std.cpp:2904:error:uninitvar:Uninitialized variable: s
2018-12-23 18:09:55 +01:00
Daniel Marjamäki
e6e3987935
snprintf/g_snprintf: do not allow uninitialized target buffer
2018-12-22 20:40:47 +01:00
amai2012
0f4eac657d
Make script less verbose
2018-12-19 22:18:24 +01:00
Daniel Marjamäki
9742c1e2ae
make checkcfg: Try to fix inline suppressions
2018-12-14 13:51:03 +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
Daniel Marjamäki
ec89c7b1b8
Travis: redundantCopy is not detected at the moment
2018-11-24 11:27:27 +01:00
orbitcowboy
ef05be2600
wxwidgets.cfg: Fixed FP due to overlaoded function wxSizer::Add().
2018-11-23 09:49:08 +01:00
Daniel Marjamäki
c181d28b1a
astyle formatting
...
[ci skip]
2018-11-23 06:47:27 +01:00
orbitcowboy
428d0147bc
wxwidgets.cfg: Added support for wxSizer::Add().
2018-11-22 14:04:22 +01:00
orbitcowboy
d6c85118a7
wxwidgets.cfg: Improved support for some wxStaticText member functions.
2018-11-22 13:47:17 +01:00
orbitcowboy
2b9bdc52d7
wxwidgets.cfg: Added support for wxWindow::Close() and derived classes.
2018-11-22 13:31:09 +01:00
orbitcowboy
b4aa04db41
std.cfg: Added returnValue calculation for isless(), islessgreater() etc.
2018-11-20 16:58:33 +01:00
orbitcowboy
58b3d75b62
std.cfg: Added invalidFunctionArg cfg for strchr().
2018-11-20 08:32:54 +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
rikardfalkeborn
613dc19b68
#4241 : Check for address of single character passed as string ( #1381 )
...
* #4241 : Check for address of single character passed as string
Add a check that address of a single character is not passed as argument
to argument marked as strings (using strz). The check does not warn if
the address of a character with known value '\0'.
Since ValueFlow currently does not handle global constants (see #7597 ),
do not warn if the variable is global to avoid FPs when the address of
a global variable assigned to '\0' is passed to a function expecting a
string.
Remove comment in docs saying strz is unused.
* Change asdf to Hello world
* Add test of address to first element in string
* Add error reporting function to getErrorMessages
* Fix strings in test
2018-10-14 18:49:34 +02:00
orbitcowboy
54c5d09ed3
test:std.cpp: Removed duplicate include <csetjmp>.
2018-10-06 00:23:14 +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
Sebastian
78715d3eff
bsd.cfg: Add arc4random* functions with tests. ( #1344 )
...
Reference: https://www.freebsd.org/cgi/man.cgi?query=arc4random
2018-08-16 21:37:40 +02:00
Sebastian
f862cf603f
posix.cfg: Add some pthread_mutex_* functions. ( #1320 )
...
References:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html
2018-07-21 17:52:12 +02:00
Sebastian
4ef452132c
posix.cfg,gnu.cfg: Add (get|set)hostname functions. ( #1315 )
...
Reference for POSIX gethostname:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html
Reference for sethostname:
http://man7.org/linux/man-pages/man2/gethostname.2.html
2018-07-18 09:40:06 +02:00
rikardfalkeborn
0e639ea7c9
runtest.sh: Bugfix cfg dir when run in test/cfg ( #1311 )
...
Commit 5cc8da2db4
introduced syntax checking of xml-files. This broke
running the file directly in the test/cfg folder since it assumed the
config files to check were located in cfg in the current working
directory. Fix this by adding a variable that holds the correct path.
2018-07-15 22:24:31 +02:00
Sebastian
5cc8da2db4
cfg/runtests.sh: Check syntax of defines in configuration files. ( #1303 )
...
travis: Add xmlstarlet package used by cfg/runtests.sh
2018-07-12 08:40:26 +02: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
55ff7c0823
test std.cfg: Updated tests for strncpy_s().
2018-05-31 11:23:54 +02:00
orbitcowboy
c7993c38b5
bsd.cfg: Added support for strlcat().
2018-05-30 16:47:00 +02:00
orbitcowboy
d412c3908f
test std.cfg: Fixed introduced regression.
2018-05-30 16:30:00 +02:00
orbitcowboy
39feb150c0
std.cfg and windows.cfg: Added support for wcscat_s() and _tcscat_s().
2018-05-30 16:25:09 +02:00
orbitcowboy
ef82477d11
std.cfg: Do not take the return value of std::locale::global() into account.
2018-05-30 16:04:40 +02:00
orbitcowboy
d06eb3eb8f
std.cfg: Added support for strcat_s() (since C11).
2018-05-30 14:30:26 +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
5b6e6db376
test std.cfg: Added more test cases for strcat() functions.
2018-05-27 10:16:02 +02:00
orbitcowboy
3407f3e932
windows.cfg: Added test cases for CreateThread().
2018-05-25 11:50:12 +02:00
orbitcowboy
d7c8c46c10
test std.cfg: Improved testing for strcat() and wcscat().
2018-05-25 08:36:47 +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
Daniel Marjamäki
21ab5c7591
Removed the generated cfg tests, these are not used.
2018-05-16 07:09:08 +02:00
Sebastian
50aa3620da
posix.cfg: Add minsize to readlink[at] function configurations ( #1216 )
2018-05-09 18:20:45 +02:00
Sebastian
b370861bed
test/cfg/std.c: Cleaning up function names and redundant tests ( #1198 )
...
Make the names of uninitvar_* functions consistent and fix typos.
Remove completely redundant functions/tests. Combine according tests if
they are not completely redundant.
2018-05-01 07:33:43 +02:00
Sebastian
6208ee4af1
std.cfg: Add asctime_s function configuration with tests ( #1191 )
...
* std.cfg: Add asctime_s function configuration with tests
* std.cfg: Remove redundant/not needed not-bool attributes.
2018-04-27 23:51:16 +02:00
Sebastian
038064436d
std.cfg: Fix minsize configuration for vsprintf ( #1188 )
...
minsize with argvalue for arg 2 which is a char pointer makes no sense.
Changing it to minsize with strlen for arg 2 results in false positives
(and i think false negatives too).
In std.c a test with a valid vsprintf usage is added that would result
in a FP when minsize with strlen for arg 2 would be used.
2018-04-25 02:52:19 +02:00
orbitcowboy
e76f1e70e8
Added tests for invalidFunctionArg.
2018-04-23 12:54:49 +02:00
Sebastian
b53c4b2032
std.cfg: Add std::vector function configurations and tests ( #1180 )
2018-04-19 16:41:25 +02:00
Sebastian
a36dad918a
std.cfg: Add std::make_pair() ( #1165 )
2018-04-11 19:16:55 +02:00
orbitcowboy
ef62207ada
std.cfg: Added more tests for some std::vector functions.
2018-04-11 17:21:26 +02:00
Sebastian
3fc53eb122
std.cfg: Add std::[w]string::compare() with tests ( #1162 )
2018-04-10 21:07:39 +02:00
orbitcowboy
270635eb1f
wxwidgets.cfg: Improved support for wxString to number conversion functions.
2018-04-07 20:27:02 +02:00
orbitcowboy
6e21d5ab84
wxwidgets.cfg: Added support for wxAtoi, wxAtol and wxAtof.
2018-04-04 21:29:55 +02:00
orbitcowboy
e3977f7e51
Formatted test/cfg files and updated 'runastyle' script. The generated test files are exclued, since they are not style-compliant.
2018-03-31 13:49:47 +02:00
orbitcowboy
d7072136dc
wxwidgets.cfg: Added support for wxMenuBar::Append().
2018-03-31 13:34:40 +02:00
orbitcowboy
43aac4696e
wxwidgets.cfg: Added support for more functions.
2018-03-31 13:23:12 +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
d3284d5d54
std.cfg: Add strncpy_s and strncat_s ( #1136 )
2018-03-26 18:38:26 +02:00
Sebastian
e38ec41ded
windows.cfg: Add some commonly used macros ( #1127 )
2018-03-22 08:31:50 +01:00
Daniel Marjamäki
dfd8ef5d52
generate_cfg_tests: fix argument count
2018-03-19 20:46:55 +01:00
Daniel Marjamäki
7202787435
posix: remove function 'remove' that is also configured in std.cfg
2018-03-19 20:04:58 +01:00
Daniel Marjamäki
3af7aef3f0
update generated cfg tests ( aca16e3
)
2018-03-19 16:25:44 +01:00
Daniel Marjamäki
6b00ca33bd
posix.cfg: Removed rename function as this is configured in std.cfg
2018-03-19 15:29:47 +01:00
Daniel Marjamäki
4e1ad40c87
update generated cfg tests ( 113f1ef
)
2018-03-19 13:51:51 +01:00
Daniel Marjamäki
6e66150feb
posix.cfg: update configuration for rename
2018-03-19 11:51:19 +01:00
Daniel Marjamäki
f94a02a61e
update generated qt.cfg tests
2018-03-19 11:51:03 +01:00
Daniel Marjamäki
b10dd5d21e
2 TODOs are fixed
2018-03-19 11:02:58 +01:00
Daniel Marjamäki
0d3ddd85b1
updated generated cfg tests
2018-03-19 09:46:16 +01:00
Daniel Marjamäki
e932c44ae6
generate cfg tests: updated NULL pointer testing
2018-03-18 19:04:17 +01:00
Daniel Marjamäki
0741c389c0
generated cfg tests: updates, most unmatched suppressions are removed now
2018-03-18 14:06:26 +01:00
Daniel Marjamäki
c800ac5118
generate_cfg_tests: updating testing for not-null
2018-03-18 13:53:46 +01:00
Daniel Marjamäki
914eea7ed1
generated cfg tests: updated test files
2018-03-18 13:22:33 +01:00
Daniel Marjamäki
cf180dcc6b
add script to generate cfg tests
2018-03-18 13:03:19 +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
Sebastian
7ba9ab7e4c
Gtk library: Add configuration to avoid syntax error, add test file ( #1109 )
...
Add configuration for G_UNLIKELY and G_LIKELY to avoid syntax errors
when these macros are used as condition without enclosing brackets.
Add test file to verify Gtk library configuration. Syntax check for the
test file is only done when Gtk+2.0 or Gtk+3.0 is found and working.
Tested on Cygwin and on Ubuntu 16.04.
2018-03-10 11:22:10 +01:00
Alexander Mai
70664e5857
Ensure wxWidgets installation is at least 2.9.5
2018-02-26 20:46:56 +01:00
Sebastian
346704b2e2
windows library: Mainly add socket functions, some other stuff and tests. ( #1095 )
...
Add Windows Socket 2 type/function configuration. There are still many
(microsoft specific) socket functions that are not yet configured.
Add configuration for GetUserName(), GetWindowText() and _fileno().
On Windows __wchar_t is a synonym for wchar_t, so an according define is
added.
2018-02-23 12:51:37 +01:00