Commit Graph

379 Commits

Author SHA1 Message Date
orbitcowboy 1df9c80e81 std.cfg: Added support for std::move(). 2019-02-17 22:45:45 +01:00
orbitcowboy 7629923b65 std.cfg: Attempt make travis happy. 2019-02-16 08:24:53 +01:00
orbitcowboy 437e171d0d std.cfg: Added partial support for std::transform(). 2019-02-15 20:56:44 +01:00
orbitcowboy 23b771c5c8 std.cfg: Added partial support for std::sort(). 2019-02-15 20:45:46 +01:00
orbitcowboy 103ec5b5a1 std.cfg: Added support for std::wifstream::seekg(). 2019-02-13 08:52:45 +01:00
orbitcowboy 81dab88413 std.cfg: Fixed wrong configuration from std::vector::pop_back(). 2019-02-13 08:04:11 +01:00
orbitcowboy 40398c6c90 std.cfg: Added support for std::vector::pop_back() and std::vector::push_back (). 2019-02-12 18:52:18 +01:00
Sebastian d9241aa532
std.cfg: Add support for std::string::replace() (#1661)
Reference: https://en.cppreference.com/w/cpp/string/basic_string/replace
2019-02-11 16:06:48 +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
orbitcowboy 1ddaa1ecf3 std.cfg: Added support for std::ifstream::seekg() and std::istream::seekg(). 2019-02-09 17:13:07 +01:00
orbitcowboy d2732e9459 std.cfg: std::string::append() added 'arg nr any'. 2019-02-09 16:58:33 +01:00
orbitcowboy 2408096cc8 std.cfg: Added support for std::string::append(). 2019-02-09 16:43:08 +01:00
Sebastian fc7494c832 std.cfg: Add support for std::map::count() (#1655)
Reference: https://en.cppreference.com/w/cpp/container/map/count
2019-02-09 09:20:42 +01:00
Daniel Marjamäki e6e3987935 snprintf/g_snprintf: do not allow uninitialized target buffer 2018-12-22 20:40:47 +01:00
orbitcowboy 4c57f0d33c std.cfg: Improved support for std::lower_bound() and std::upper_bound(). 2018-11-27 13:55:06 +01:00
orbitcowboy b4aa04db41 std.cfg: Added returnValue calculation for isless(), islessgreater() etc. 2018-11-20 16:58:33 +01:00
orbitcowboy a722ba4f89 std.cfg: Improved return value configuration for std::min() and std::max(). 2018-11-20 16:07:16 +01:00
orbitcowboy 58b3d75b62 std.cfg: Added invalidFunctionArg cfg for strchr(). 2018-11-20 08:32:54 +01:00
yurii.putin 2aecd30cd8 Change cfg
Add some function (posix_memalign, reallocarray,aligned_alloc,valloc) to cfg. Add attribute format-str to some function.
2018-11-19 18:23:00 +01:00
Daniel Marjamäki 142f921d52 remove <pure/> from strtok. It has an internal state. This fixes FPs. 2018-09-08 12:08:09 +02:00
rikardfalkeborn 30a8d953e3 Move sqrt{,f,l} argument checks to cfg file (#1313) 2018-07-20 20:56:39 +02:00
rikardfalkeborn 491ee577c6 Support floats in valid config (#1297)
* Add tests for invalid ranges

* Refactor loadLibErrors

This reduces the amount of code slightly and will simplify adding
more tests.

* Handle empty valid field

Before this change, the sequence <valid></valid> in a config file would
result in a segmentation fault. Now an empty field results in the error
message:

cppcheck: Failed to load library configuration file 'mycfg.cfg'. Bad attribute value '""'

* Add support for valid for floating point arguments

Previously, it was not possible to add valid ranges to floating point
arguments since it only handled integers. This made ranges not work well
for floating point arguments since arguments were cast to integers
before the ranges were handled.

Fix this by using doubles instead of integers if the argument is a float.
Add some tests for this and make sure errors are printed with enough
precision (somewhat arbitrarily chosen).

Note that it is still only possible to add integer ranges (i.e. -1:1).

* Add support for floats in configuration valid range

Now that it is possible to handle decimal arguments, there is no reason
to not allow non-integer ranges. Take care to not allow broken
configurations.

* Move check to within if-clause

* Move asin{,f,l} and acos{,f,l} input checks to config file
2018-07-15 22:47:56 +02:00
orbitcowboy 8472779c00 std.cfg: Added support for wcsncpy_s(). 2018-06-07 11:57:03 +02:00
orbitcowboy fe8cab1749 Removed platform specifc constants from previous commit. 2018-06-01 12:07:46 +02:00
orbitcowboy 34372aaf00 std.cfg: Added some floating point constants from <math.h>. 2018-06-01 11:45:05 +02:00
Daniel Marjamäki f326021a75 std.cfg: strncpy_s wrongly had <not-uninit/> in first argument 2018-05-31 07:03:07 +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
Sebastian fdc98e5665
std.cfg: Add rsize_t and errno_t configurations. (#1229) 2018-05-16 10:12:37 +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 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 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
Sebastian d3284d5d54 std.cfg: Add strncpy_s and strncat_s (#1136) 2018-03-26 18:38:26 +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
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 51fce24d95 std.cfg: Add offsetof configuration (#1097) 2018-02-23 18:49:52 +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
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
orbitcowboy ff3c0993ac std.cfg: Fixed FP for wcsxfrm(), mentioned in #6306. 2018-02-05 22:13:08 +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 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 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
Sebastian 6bd524baaf std.cfg: Fix copy&paste error or typo (#1033)
* Fixed copy&paste error or typo

It should be std::sinf here. std::sinl is described directly in the next function description and does not make sense here because of the return type.

* std.cfg: Fix another copy&paste error or typo

It should be std::tanf here.
2018-01-16 08:36:04 +01:00