Commit Graph

36 Commits

Author SHA1 Message Date
chrchr-github b8b6b41833
Fix #10802 Broken AST lambda inside for loop (#4520)
* Fix #10802 Broken AST lambda inside for loop

* Add some boost and wxwidget defines (on behalf of "david ingamells")
2022-09-29 13:29:50 +02:00
Maurice Gilden d1b3670017
Improve definitions for boost test macros (#3625)
Using assert in macros causes assertWithSideEffect in some cases, which is not
a valid issue for these macros.
Macros for test case/suite were causing unusedStructMember warnings because
the test function could not be parsed correctly. The new defines don't match
completely what the macros really do, but it seems to be a good enough
approximation.
2021-12-15 20:51:29 +01:00
chrchr-github c073123343
Add some macros to boost.cfg (#3487) 2021-10-06 16:25:55 +02:00
Paul Fultz II 8668d445c7
Add support for string_view (#3480) 2021-10-05 08:28:19 +02:00
ChristophStrehle 4f8b1b2f20
Add macros for data and template tests (#3395) 2021-08-13 18:07:18 +02:00
Daniel Marjamäki b1547a387e astyle formatting
[ci skip]
2021-07-21 20:13:38 +02:00
Paul Fultz II 8efe1d4ab4
Find reference to dangling unique ptr (#3344) 2021-07-20 21:30:27 +02:00
Lukasz Czajczyk 0a06a083af
Additional macros (#3106) 2021-02-20 13:19:06 +01:00
Georgy Komarov b90b87af5b
boost.cfg: Add support for more interfaces (#2838) 2020-10-05 09:07:47 +02:00
orbitcowboy 45a782264c boost.cfg: Added support for BOOST_PP_CAT-macro 2020-10-04 08:25:30 +02:00
Georgy Komarov 7d5a6d2470
boost.cfg: Add support for more functions (#2835) 2020-10-04 08:22:55 +02:00
orbitcowboy b51158db71 boost.cfg: Added support for more interfaces 2020-10-03 20:19:52 +02:00
Daniel Marjamäki 6756587ac9 astyle formatting
[ci skip]
2020-06-18 12:05:24 +02:00
Ken-Patrick Lehrmann c297ed8204 Better handle noreturn or throwing functions in valueflow
Teaching cppcheck about `BOOST_THROW_EXCEPTION` and
`boost::throw_exception`, and using noreturn information from libraries
in value flow.

This fixes false positive nullPointerRedundantCheck with the following
code:
```
void throwexception(int * buf)
{
    if (!buf)
        boost::throw_exception(std::bad_alloc());
    *buf = 0;
}
```
2020-06-17 19:06:14 +02:00
Paul Fultz II a22a77c1fc
Use library config for unstable containers instead of hardcoded values (#2585)
* Use library config for unstable containers instead of hardcoded values

* Fix xml validation
2020-04-03 13:16:57 +02:00
Daniel Marjamäki 53cc922765 Fixed #9374 (False Positive - constParameter) 2019-11-16 13:59:41 +01:00
Sebastian 0fadae78d3 boost.cfg: Add configuration and tests for boost::bind() (#2206) 2019-09-25 12:49:05 +02:00
versat 2080fbeecf boost.cfg: Add macros found by daca@home 2019-09-18 10:59:54 +02:00
orbitcowboy 606b26fb86 boost.cfg: Improved support for more macros. 2019-09-16 13:34:08 +02:00
orbitcowboy 3b70a6868b boost.cfg: Added support for more macros, found by daca@home. 2019-09-15 13:34:08 +02:00
orbitcowboy c1773225e7 boost.cfg: Added support for some math macros 2019-08-02 12:01:52 +02:00
ChristophStrehle f7f60a8da6 Variable number of arguments for boost test suite macros (#2043)
The macros defined in unit_test_suite.hpp have a variable
number of arguments if BOOST_PP_VARIADICS is defined.

See:
https://github.com/boostorg/test/blob/develop/include/boost/test/unit_test_suite.hpp
2019-07-28 09:23:27 +02:00
Paul Fultz II 091f4bcf8d Add check for unnecessary search before insertion
This will warn for cases where searching in an associative container happens before insertion, like this:

```cpp
void f1(std::set<unsigned>& s, unsigned x) {
    if (s.find(x) == s.end()) {
        s.insert(x);
    }
}

void f2(std::map<unsigned, unsigned>& m, unsigned x) {
    if (m.find(x) == m.end()) {
        m.emplace(x, 1);
    } else {
        m[x] = 1;
    }
}
```

In the case of the map it could be written as `m[x] = 1` as it will create the key if it doesnt exist, so the extra search is not necessary.

I have this marked as `performance` as it is mostly concerning performance, but there could be a copy-paste error possibly, although I dont think thats common.
2019-05-02 11:04:23 +02:00
Sebastian 53357f2f31
boost.cfg: Add configuration for Boosts smart pointers (#1811) 2019-04-26 12:41:44 +02:00
versat 6f7612de03 boost.cfg: Add argument directions; some fixes; rearrange and document.
- Remove redundant function configurations for the same function since
it is not (yet) possible to configure overloaded functions. Instead mark
the optional arguments with `default="0"` so the configuration works
with a different number of arguments.
- Add documentation to boost.cfg (links and function declarations).
- Rearranged configurations so functions, defines, ... are together now.
- Add `direction` for function arguments where applicable.
- Add some tests to boost.cpp.
2019-03-15 11:13:08 +01:00
Sebastian 08d41ab8af
Load std.cfg before all other libraries (#1740)
- CLI: Save the libraries that should be loaded to a list and load them
after the std.cfg has been loaded.
- GUI: Load std.cfg (and windows.cfg / posix.cfg when applicable) before
setting other options and loading the other libraries.
In the project-file-dialog the std.cfg is searched first. If some
other library fails to load is is retried with first loading std.cfg.
- boost.cfg: Enable containers that depend on std containers.
2019-03-15 06:59:37 +01:00
orbitcowboy b7c40d972b boost.cfg: Fixed typo in macro. 2019-03-05 19:00:13 +01:00
orbitcowboy 2ddba8f352 boost.cfg: Added support for BOOST_LOG_ATTRIBUTE_KEYWORD-macro. 2019-03-05 18:53:34 +01:00
orbitcowboy 571e6bcecc running astyle. 2019-02-22 16:15:08 +01:00
Steven Cook 71018d6d17 boost.cfg additions (#1680) 2019-02-22 15:21:06 +01:00
orbitcowboy 8820580cf6 boost.cfg: Improved support for more test macros. 2019-02-17 22:36:36 +01:00
orbitcowboy b886590cc9 boost.cfg: Improved support for more test macros. 2019-02-17 21:14:03 +01:00
orbitcowboy 4e42f83bc8 boost.cfg: Fixed some 'unknownMacro'-warnings from daca@home. 2019-02-17 20:52:54 +01:00
Sebastian 0aa4910244
Boost configuration: Add macros and initial test file (#1575) 2019-01-08 20:30:21 +01:00
orbitcowboy 02e1637553 wxwidgets.cfg: Improved support for some wxBitmap functions. 2018-12-13 17:04:02 +01:00
Daniel Marjamäki b91ef62932 Add boost.cfg 2018-12-13 09:06:35 +01:00