Commit Graph

812 Commits

Author SHA1 Message Date
orbitcowboy 75e28e46c5 windows.cfg: Added support for _mbscat(). 2018-05-28 10:08:11 +02:00
versat 10292c1202 microsoft_sal.cfg: Add the missing Advanced Annotations
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383701(v=vs.85).aspx (Advanced Annotations are near the bottom)
2018-05-25 14:26:32 +02:00
orbitcowboy 3407f3e932 windows.cfg: Added test cases for CreateThread(). 2018-05-25 11:50:12 +02:00
versat 6a5bf33b0d microsoft_sal.cfg: Add RPC SAL Annotations from rpcsal.h 2018-05-25 10:28:58 +02:00
orbitcowboy d7c8c46c10 test std.cfg: Improved testing for strcat() and wcscat(). 2018-05-25 08:36:47 +02:00
orbitcowboy c07abdd382 windows.cfg: Added more constants from Rpcdce.h. 2018-05-24 16:00:06 +02:00
orbitcowboy 18b452111f windows.cfg: Added constants from Rpcdce.h. 2018-05-24 15:54:01 +02:00
orbitcowboy df8a5966bb windows.cfg: Added constant definitions from AccCtrl.h 2018-05-24 15:49:28 +02:00
orbitcowboy 792d5a7cf4 windows.cfg: Added missing COM macros, defined at https://msdn.microsoft.com/en-us/library/windows/desktop/dd542715(v=vs.85).aspx. 2018-05-24 15:27:40 +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
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
orbitcowboy 3ad8fa5288 windows.cfg: Improved support for more types. 2018-05-16 16:26:40 +02:00
Sebastian 748f50cf85
windows.cfg: Add 32/64 bit time related functions and types. (#1236)
Fix declaration comments for _localtime32_s() and _localtime64_s().
Add functions _time32 and _time64, and types __time32_t and __time64_t.
References: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-s-localtime32-s-localtime64-s
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64
2018-05-16 12:42:50 +02:00
Sebastian fdc98e5665
std.cfg: Add rsize_t and errno_t configurations. (#1229) 2018-05-16 10:12:37 +02:00
orbitcowboy 4e38627a3d windows.cfg: Improved support for Windows types (ref. https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx ). 2018-05-16 09:16:12 +02:00
orbitcowboy 98e64e76f7 windows.cfg: Improved support for Windows types (ref. https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx ). 2018-05-16 00:23:58 +02:00
orbitcowboy 3e3a8af267 windows.cfg: Improved support for Windows types (ref. https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx ). 2018-05-16 00:09:45 +02:00
orbitcowboy d0089fe305 windows.cfg: Added missing PFLOAT definition. 2018-05-15 09:43:28 +02:00
Sebastian 50aa3620da
posix.cfg: Add minsize to readlink[at] function configurations (#1216) 2018-05-09 18:20:45 +02:00
Sebastian 90bc8b7404
posix.cfg: Add not-bool to last arguments where appropriate. (#1204)
Add not-bool function argument configuration where appropriate to catch errors like this: df4ca5fb72
2018-05-08 09:30:08 +02:00
Sebastian 0a95fb4b70
qt.cfg: Add some QStandardItem[Model] functions (#1200) 2018-05-02 21:03:55 +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
orbitcowboy eb922a140a wxwidgets.cfg: Added support for wxOVERRIDE. 2018-04-27 23:18:34 +02:00
Sebastian 4b104c4576
std.cfg: Add some missing C++11 declarations comments and not-bool attributes (#1183) 2018-04-25 08:54:36 +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
Sebastian 40c42f2de7
qt.cfg: Add some functions used in the GUI, remove redundant const (#1189) 2018-04-24 16:37:55 +02:00
Sebastian 86d54c63c6
qt.cfg: Add more QString:: methods, fix errors. (#1185)
Additionally fix QString::sprintf() and QString::asprintf()
configurations.

Fix typo in quin[i]tptr.

Add warning for QString::sprintf and QString::vsprintf.
These functions are obsolete since Qt5, see
https://doc.qt.io/qt-5/qstring-obsolete.html
2018-04-24 12:23:23 +02:00
Sebastian b53c4b2032 std.cfg: Add std::vector function configurations and tests (#1180) 2018-04-19 16:41:25 +02:00
versat 3a52f217d3 microsoft_sal.cfg: Add some missing annotations 2018-04-13 11:39:26 +02:00
Sebastian 9e623b15b1
windows.cfg: Add SetFilePointer() function configuration (#1167) 2018-04-12 16:09:11 +02:00
Sebastian 26e22a9f5c
qt.cfg: Add/Enhance Qt macros and functions (#1164)
Qt macro Q_D() is disabled for now until ticket 8479 gets fixed.
2018-04-12 13:40:02 +02:00
Sebastian c39a3e3f1c
windows string macros: Handle _T, _TEXT and TEXT internally, add tests (#1163)
Remove TEXT() macro from windows.cfg and handle it internally where it
can be correctly simplified (Ansi vs. Unicode).
Also add handling of _TEXT() macro which is just a synonym for _T().
Add tests to verify correct function and macro simplification.
2018-04-12 08:52:31 +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
versat 8aa71d62a0 Revert "windows.cfg: Add macros _TEXT() and _T() (#1161)"
This reverts commit 9db64ca934.
2018-04-11 08:37:15 +02:00
Sebastian 3fc53eb122 std.cfg: Add std::[w]string::compare() with tests (#1162) 2018-04-10 21:07:39 +02:00
Sebastian 9db64ca934
windows.cfg: Add macros _TEXT() and _T() (#1161) 2018-04-10 18:39:59 +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 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 bbb43155bf
qt.cfg: Fix false positives for function disconnect (#1137)
There is no problem with a null pointer as third argument. 0 is used as
wildcard and stands for all receivers for example.
2018-03-27 15:54:24 +02:00
orbitcowboy 98b4c5689f wxwidgets.cfg: Improved support for more wxWidgets macros. 2018-03-27 14:24:59 +02:00
Sebastian d3284d5d54 std.cfg: Add strncpy_s and strncat_s (#1136) 2018-03-26 18:38:26 +02:00
orbitcowboy db045c2bf6 wxwidgets.cfg: wxBEGIN_EVENT_TABLE: Added 'void' to functions without arguments. 2018-03-26 16:07:10 +02:00
orbitcowboy 22291d2262 wxwidgets.cfg: Improved support for BEGIN_EVENT_TABLE and END_EVENT_TABLE-macros. 2018-03-26 16:02:48 +02:00
orbitcowboy 3b935af90e wxwidgets.cfg: Added support for wxDECLARE_EVENT_TABLE. 2018-03-26 10:28:12 +02:00
Sebastian 670267f3d1 std.cfg: Smaller enhancements and fixes (#1133)
Add missing returnValue types where appropriate and fixed a few wrong
ones.
Add some missing function names (mostly where the "std::" version of the
function is missing).
Add documentation for some functions where it is missing.
Remove functions that do not exist in the standard: std::array::clear,
std::vector::push_front.
2018-03-23 22:58:20 +01:00
Sebastian e38ec41ded
windows.cfg: Add some commonly used macros (#1127) 2018-03-22 08:31:50 +01:00
amai2012 e8cccf842f Correct attributes for swab() 2018-03-20 11:40:50 +01:00
Daniel Marjamäki 7048f012a8 astyle formatting
[ci skip]
2018-03-19 20:33:36 +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
Sebastian 8cff60b461
windows.cfg: Add missing documentation and returnValue types (#1125)
Additionally a few minor issues were fixed.
2018-03-19 16:18:48 +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
amai2012 113f1efd72 Add configuration for swab() and sync() 2018-03-19 13:12:16 +01:00
Daniel Marjamäki 6e66150feb posix.cfg: update configuration for rename 2018-03-19 11:51:19 +01:00
Paul Fultz II 4ef445e228 Add const to empty and size functions (#1124) 2018-03-19 09:58:22 +01:00
Daniel Marjamäki 7d0b5f7c8d std.cfg: allow std::string::find() argument '\0' 2018-03-19 09:43:15 +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 af4181f4d1
Qt library: Add missing podtype information (#1115)
The type qintptr was missing.
qlonglong, qulonglong and uchar have known sizes, so the sizes can be
specified.
2018-03-13 12:54:17 +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
Sebastian c63cda4439
Qt library: Add missing comments and attributes and fixed some configurations (#1110) 2018-03-09 20:19:59 +01:00
Sebastian 152fc83bf0
Qt library: Add some function configurations (#1105) 2018-03-07 15:24:36 +01:00
orbitcowboy d637d414e1
wxwidgets.cfg: Fixed wrong function names. 2018-03-05 13:49:12 +01:00
orbitcowboy e824301cb5
wxwidgets.cfg: Fixed wrong function name. 2018-03-05 13:43:27 +01:00
orbitcowboy 402ca256be wxwidgets.cfg: Added support for wxGrid::SetCellTextColour. 2018-03-05 13:12:24 +01:00
orbitcowboy c31c54f1a4 wxwidgets.cfg: Improved support to for some wxSizerItem functions. 2018-03-05 00:25:47 +01:00
Martin Ettl 5bdab9e85a wxwidgets.cfg: Improved support for some wxString functions. 2018-02-26 13:57:24 +01:00
Martin Ettl 6af8aa63f6 windows.cfg: Improved support for _tolower()/_toupper() functions. 2018-02-25 16:38:29 +01:00
Martin Ettl 1df0ac15a3 windows.cfg: Added support for _toupper() and _tolower(). 2018-02-25 13:30:12 +01:00
Sebastian 51fce24d95 std.cfg: Add offsetof configuration (#1097) 2018-02-23 18:49:52 +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
Sebastian 1d14919649
wxwidgets: Fix syntax checking errors and warning (#1093)
wxDebugContext is only defined if wxUSE_DEBUG_CONTEXT is 1, so otherwise
just skip it for syntax checking because it will fail.
Change wxT to wxT_2 and add wxT_2 to the config to remove a warning
during syntax check and be more compatible with newer/older wxwidgets
versions.
Be more precise when replacing function like macros, fix redundant macro
definition for "_".
2018-02-21 12:20:56 +01:00
orbitcowboy 2ce8a3fc95 wxwidgets.cfg: Improved support for some deprecated functions. 2018-02-20 23:34:01 +01:00
orbitcowboy 2ab347606a std.cfg: Improved support for some std::ofstream functions. 2018-02-20 22:36:45 +01:00
orbitcowboy 31399e556b std.cfg: Improved configuration for ptrdiff_t. 2018-02-20 01:00:12 +01:00
orbitcowboy 2defdb7d4c wxwidgets.cfg: Added more deprecated functions. 2018-02-14 09:53:40 +01:00
Sebastian 6a3dc6ad45
Qt library: Add some function configurations (#1086) 2018-02-12 08:36:50 +01:00
orbitcowboy 8ef56972da wxwidgets.cfg: Added more deprecated-functions. 2018-02-11 16:58:39 +01:00
Sebastian 9eb6d38c06 std library: Add tests for wide character string functions, fix config (#1085)
Add equivalent tests for the wide character string functions like they
are already done for the normal string functions.
Fixed some issues with the configuration of the wide character string
functions that arised through the tests and were already fixed for the
normal string functions.
2018-02-09 21:17:01 +01:00
Daniel Marjamäki 7b3898f0f4 astyle formatting
[ci skip]
2018-02-08 21:58:43 +01:00
orbitcowboy dccf96cb7b wxwidgets.cfg: Added more deprecated functions. 2018-02-07 13:33:15 +01:00
orbitcowboy dea662891a wxwidgets.cfg: Added some functions from the deprecated wxWidets-list (http://docs.wxwidgets.org/trunk/deprecated.html). 2018-02-07 11:40:42 +01:00
Sebastian 14e45f9dcb
wxwidgets library: Fix/Enhance cfg, add test file (#1082)
Add test file for wxwidgets configuration, fix found issues and enhance
the cfg a bit:
Fix declarations in comments for wxLog* functions.
Merge the two wxTextFile::Create overloaded function configurations into
one that works for both now.
Removed use-retval attribute from wxBoxSizer::AddSpacer and
wxButton::SetDefault configuration since the functions have side effects
and there is no need to use the return value.
Add some function configurations, the macro _(str) and POD wxLogLevel.
2018-02-06 15:33:45 +01:00
Sebastian 80c2074ea7
cppcheck-cfg.rng: Allow return value by reference (#1077) 2018-02-06 08:33:20 +01:00
orbitcowboy ff3c0993ac std.cfg: Fixed FP for wcsxfrm(), mentioned in #6306. 2018-02-05 22:13:08 +01:00
Sebastian 2e5d7a8391 Fix #8381: false positives for swprintf_ and stprintf_s (#1080)
This fixes false positives because of wrong configuration in
windows.cfg.
Add tests in testio.cpp and test/cfg/windows.cpp to avoid regression.
2018-02-03 05:10:52 +01:00
Sebastian c235930539
windows library: Add function configurations with tests (#1079)
Add function configurations with tests for:
GetLocalTime, GetSystemTime, GetLastError, SetLastError,
AllocateAndInitializeSid, FreeSid, HeapAlloc, HeapReAlloc, HeapFree,
HeapSize, HeapValidate and GetProcessHeap.
test/cfg/runtests.sh: Enable --inconclusive for the windows tests to
avoid some issues in the future.
2018-02-02 11:28:54 +01:00
Sebastian 1ad22ae231 windows library: Add strlwr/strupr configuration, fixing tests (#1076)
Add configuration for the deprecated strlwr/strupr functions with
according warning.
test/cfg/windows.cpp: Added tests for strlwr and strupr. Moved function
call that does not return (FreeLibraryAndExitThread) to the end of the
function to fix analysis that was silently aborted at that point
(reported as issue #8378).
2018-01-31 17:43:19 +01:00
Sebastian 7b02b45a76 posix library: Add strtok tests (#1069)
* posix library: Add strtok tests

In the posix library there is the same configuration for strtok but a
warning is added.

* posix.cfg: Remove redundant configuration for strtok, add comment.
2018-01-31 10:58:30 +01:00
Sebastian c62abee07a
windows library: Add _malloca/_freea and _alloca configuration with tests (#1071) 2018-01-30 16:40:38 +01:00
Sebastian 4b5e4f989a std config: Remove misspelled function "strbprk" (#1065)
Remove misspelled function configuration "strbprk" (also from the
tests). The correct function "strpbrk" is already configured and tested.
2018-01-29 17:28:44 +01:00
Sebastian 30b9391461
windows library: Enhance Event function configuration, add tests (#1064) 2018-01-29 14:08:56 +01:00
Sebastian 6b5805041b std.cfg: Fixed remaining functions found to be redundant (#1055)
[std::]strtoimax and [std::]strtoumax:
They were nearly completely duplicates, i removed the ones with
less/missing configuration.
std::basic_string::empty:
It was found to be redundant because very likely someone forgot to
change "empty" to "clear" when copy&pasting the function names. The
empty function in all these clear functions makes no sense, and the
clear function also was missing.
std::queue::empty and std::array:empty:
They were both twice in the same function name list.
std::string::size, std::wstring::size:
They were already configured with many other size functions above.
std::basic_string::size:
This entry was twice in the same function name list directly one after
another. Very likely one of them should be the length function, which
does simply the same but was missing in the std.cfg.
2018-01-24 15:31:55 +01:00
Sebastian 26ff750848 windows.cfg: Add Mutex function configurations (#1051) 2018-01-24 09:50:05 +01:00
Sebastian d46cd46d0f windows.cfg: Add _countof macro configuration (#1047)
By telling cppcheck about the Microsoft Windows _countof() macro it is
now able to detect out of bounds array accesses like this:
wchar_t buf[10];
for(size_t i = 0; i <= (_countof(buf)); ++i) {
buf[i] = L'\0'; // (error) Array 'buf[10]' accessed at index 10, which
is out of bounds.
}
2018-01-23 15:45:06 +01:00
Sebastian a4deca3c98 posix.cfg: Remove redundant entries (#1049)
I carefully removed the duplicate/redundant entries with less/missing
configuration, so no information is lost.
2018-01-22 17:21:07 +01:00
Sebastian 4dbeffd615 std.cfg: Fix redundant function names (#1050)
This fixes some more redundant function configurations. Seems like they
are the result of copy & paste errors.
2018-01-22 17:18:36 +01:00