Commit Graph

366 Commits

Author SHA1 Message Date
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
orbitcowboy a01c6c95eb std.cfg: Added missing non-namespace configuration for stoi()-like functions. 2017-12-15 21:42:39 +01:00
orbitcowboy b14146b853 std.cfg: Improved configuration of wcsncpy. 2017-12-08 21:21:26 +01:00
orbitcowboy 77c43f2d24 #8293: Applied fix from versat. 2017-12-08 09:33:54 +01:00
Daniel Marjamäki 1e870762a3 std.cfg: open/save with GUI 2017-11-12 15:17:58 +01:00
Daniel Marjamäki 1699775c3c std.cfg: Save from GUI 2017-11-12 15:11:37 +01:00
orbitcowboy 589ce19822 Added support for std::ios::clear. 2017-10-18 14:16:36 +02:00
orbitcowboy 51eb4ffe9b std.cfg: Added support for std::string::reserve(). 2017-10-15 11:22:42 +02:00
orbitcowboy a886f4f649 std.cfg: Added support for std::string::erase(). 2017-10-15 11:17:17 +02:00
orbitcowboy db787369b9 #8243: Changed order of includes. Moved mathlib include at first place. 2017-10-14 16:30:10 +02:00
Daniel Marjamäki 81beb47e5c std.cfg: Added std::...::insert configurations 2017-10-13 15:39:08 +02:00
orbitcowboy 3c96924c56 std.cfg: Improved support for std::string::resize(). 2017-10-13 10:22:59 +02:00
orbitcowboy 43de937a4e Removed not needed <use-retval/> from std::string::resize(). 2017-10-13 10:15:53 +02:00
orbitcowboy 8160cc2fc6 std.cfg: Improved support for find, std::string functions. 2017-10-13 09:58:23 +02:00