Commit Graph

22219 Commits

Author SHA1 Message Date
Paul Fultz II 3975913637 Extend lifetime checking for references
This will use the lifetime checker for dangling references. It will find these cases for indirectly assigned reference:

```cpp
int &foo()
{
    int s = 0;
    int& x = s;
    return x;
}
```

This will also fix issue 510 as well:

```cpp
int &f( int k )
{
    static int &r = k;
    return r;
}
```
2019-01-23 07:29:16 +01:00
amai2012 db413d254a Add G_CALLBACK() to gtk.cfg 2019-01-22 22:11:06 +01:00
amai2012 44c12ccb31 Add connect() to posix.cfg 2019-01-22 21:51:04 +01:00
Daniel Marjamäki 8c07be136a Fixed #8949 (False Positive: Variable 'f' is assigned a value that is never used.) 2019-01-22 21:16:27 +01:00
Daniel Marjamäki d35a26c6f0 --check-library fix 2019-01-22 19:40:39 +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
orbitcowboy 737f357280 wxwidgets.cfg: Added support for wxPaintDC::SetFont(). 2019-01-22 16:03:50 +01:00
orbitcowboy 98f4ddd9b5 wxwidgets.cfg: Added support for wxStaticText::SetFont(). 2019-01-22 16:01:37 +01:00
Sebastian a410cea59a
Donate CPU: Collect information messages and provide checkLibrary reports (#1610)
Related trac ticket: https://trac.cppcheck.net/ticket/8947
Enable information messages and "--check-library" in the Cppcheck
parameters.
Store the information messages and the rest of the messages in different
variables and upload them separately.
The server stores the information messages in a sub-directory similarly
to the normal issue messages in one file per package.
Reports for "checkLibraryFunction" and "checkLibraryNoReturn" message ids
are generated by the server now.
2019-01-22 15:27:13 +01:00
orbitcowboy 6b61866d59 wxwidgets.cfg: Improved support for wxFileDialog functions. 2019-01-22 08:36:37 +01:00
Sebastian 72c9646be9
misra.py: Possible fix for problematic code (#1613)
Without the `for scope in data.scopes:` loop, scope is not assigned anything.
From the context a loop over `data.scopes` could be intended. But other things like indentation would be possibly correct too. Not sure how this code should be.
We try this fix.
2019-01-22 07:28:29 +01:00
Daniel Marjamäki 149d688e9a Fix return value from ErrorLogger::reportUnmatchedSuppressions 2019-01-22 06:45:22 +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
Daniel Marjamäki 4119cfd3d1 Correct exit code when there are no unmatched suppressions 2019-01-21 20:33:22 +01:00
Paul Fultz II 4b37f276c2 ValueFlow: Set arrays to true when converting to a boolean
This sets it by checking the parent. It doesn't handle function parameters yet.
2019-01-21 20:05:35 +01:00
orbitcowboy 63660fcc2b wxwidgets.cfg: Improved support for more constants from wx/defs.h 2019-01-21 17:14:53 +01:00
orbitcowboy 030ab66e4d wxwidgets.cfg: Added support for wxGrid::DrawTextRectangle() 2019-01-21 16:33:07 +01:00
orbitcowboy 84d80909b0 wxwidgets.cfg: Added support for wxGrid::MakeCellVisible(int row, int col). 2019-01-21 16:25:29 +01:00
orbitcowboy ce254fe3a5 wxwidgets.cfg: Added support for macros from wx/html/htmlwin.h 2019-01-21 11:02:03 +01:00
orbitcowboy d1c4c7d214 wxwidgets.cfg: Improved support for wxWidgets constants. 2019-01-21 10:53:24 +01:00
orbitcowboy 7bc776abea wxwidgets.cfg: Improved support for wxWidgets macros and constants. 2019-01-21 10:50:42 +01:00
Daniel Marjamäki 91435310cb Fixed #8925 (compile_commands.json: False positives in .mm (Objective-C++) files, that file type should maybe just be ignored) 2019-01-21 06:36:31 +01:00
Daniel Marjamäki a26287f491 Fix Token::findExpressionStartEndTokens() regression 2019-01-20 13:23:19 +01:00
Daniel Marjamäki 8da4e31c42 Fixed #8941 (False Positive: Variable 'f' is assigned a value that is never used.) 2019-01-20 13:20:23 +01:00
Daniel Marjamäki 0f19dfea82 Do not check unmatched suppressions in --check-library checking 2019-01-20 10:30:38 +01:00
rikardfalkeborn f7d85e9df2 Add regression test for #6904 (#1611)
Ticket #6904 was fixed in 34dbc3c00c.
Add a regression test to make sure it doesn't reappear.
2019-01-20 10:05:09 +01:00
Daniel Marjamäki 0945e827c6 Fixed #8931 (Missing error exitcode when an unmatched suppression is detected) 2019-01-19 21:42:01 +01:00
versat dfaba30290 donate-cpu.py: Fix possible usage of none type variable
"bandwidth_limit" is None by default and therefore can not be used for string
concatenation in this case.
2019-01-19 12:45:08 +01:00
Sebastian e3db99a16e
donate-cpu.py: Add option for limiting bandwidth (#1606)
With this new option it is possible to limit the download rate / bandwidth that wget uses to download packages.
The value is verified by running wget with it and check if there is a parse error (exit code 2). If the value is not valid an error message is shown and the script exits with an error code.
2019-01-18 21:36:03 +01:00
Sebastian c106dd2939
misra addon: Fix issue with unexpected encodings in loadRuleTexts() (trac 8946) (#1608)
https://trac.cppcheck.net/ticket/8946
Add tests to travis script for verifying rule text loading.
Add dummy rule text files.
misra.py: Try to find a suitable codec for rule texts file.
2019-01-18 21:30:08 +01:00
Paul Fultz II 9e4b605fca Properly find pcre (#1607) 2019-01-18 21:13:35 +01:00
IOBYTE 1acbdde302 Fixed #7417 ("syntax error" in valid code containing explicitly specialised variable template) (#1604) 2019-01-18 21:12:39 +01:00
Sebastian 4b1544d33b
library.cpp: Let tinyxml2 print a helpful error message when XML is bad (#1609)
In case the XML code of a library configuration is invalid Cppcheck now additionally prints out some helpful error description like this:
"Error=XML_ERROR_MISMATCHED_ELEMENT ErrorID=16 (0x10) Line number=304: XMLElement name=noreturn"
2019-01-18 17:10:41 +01:00
orbitcowboy 80a6d7c390 wxwidgets.cfg: Improved support for some wxGrid functions. 2019-01-18 16:03:20 +01:00
orbitcowboy 204db723e3 wxwidgets.cfg: Reordered entries: 1) Macros 2) POD-types and 3) Function defintions. 2019-01-18 15:54:37 +01:00
orbitcowboy 2ae9ba60bf wxwidgets.cfg: Added support for wxDC:DrawBitmap(). 2019-01-18 15:51:30 +01:00
orbitcowboy bbc2bcb7a8 wxwidgets.cfg: Improved support for macros from wx/property.h 2019-01-17 16:58:12 +01:00
orbitcowboy bdad1a3e3f wxwidgets.cfg: Added support for wxGrid::SetCellValue() 2019-01-17 16:41:20 +01:00
orbitcowboy ec592032a1 wxwidgets.cfg: Improved support for functions and macros from wxPGProperty. 2019-01-17 16:32:26 +01:00
versat be14517bcd donate-cpu.py: Fix too few return values in scanPackage()
In case a crash is detected the scanPackage() function returns too few values (three instead of four).
This likely leads to an exception then.
2019-01-17 14:58:15 +01:00
orbitcowboy cdae767bd8 windows.cfg: Added support for some constants from WinBase.h 2019-01-16 15:54:18 +01:00
orbitcowboy 705fa1820c windows.cfg: Added support for some constants from winnt.h and WinBase.h 2019-01-16 15:51:14 +01:00
orbitcowboy 11cf28e6ab wxwidgets.cfg: Improved support for wxArrayString functions. 2019-01-16 15:11:27 +01:00
orbitcowboy 347e3a121a wxwidgets.cfg: Added support for wxArrayString::push_back(). 2019-01-16 15:05:10 +01:00
orbitcowboy 270bceb1b6 windows.cfg: Added support for some return flags from GetHandleInformation(), ref.: https://msdn.microsoft.com/en-us/library/ms724329%28v=vs.85%29.aspx 2019-01-16 14:53:02 +01:00
orbitcowboy 6b16709b92 wxwidgets.cfg: Added support for wxTextCtrl::SetValue(). 2019-01-16 12:01:56 +01:00
orbitcowboy 061ee3e886 wxwidgets.cfg: Added support for wxButton::Enable(). 2019-01-16 10:56:47 +01:00
orbitcowboy 050fd0a64c wxwidgets.cfg: Added support for wxGrid::DrawTextRectangle(). 2019-01-16 10:49:03 +01:00
orbitcowboy cd2ac71e71 wxwidgets.cfg: Added support for wxConfigBase::Write() and wxConfigBase::Read(). 2019-01-16 09:52:24 +01:00