-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning from Clang Static Analyzer about returning null reference #1230
Comments
The second warning is definitely bogus, but I'll take a look at the null deref. Btw, looking through the changes, you might be interested in |
Finally got around this and it is definitely a false positive. The analyzer suggests that the problem occurs when currentContext = new Context(); Obviously, there is no way to have the |
As there has been no followup and, as far as I can tell, there is no issue, I am going to close this. |
Thanks for checking. Indeed there I can't follow up on this. Keep up the good work on Catch! 👍 |
Reported https://bugs.llvm.org/show_bug.cgi?id=39201 upstream. |
It still reproduces with Clang 7.0 and Catch2 2.4.1. |
This still happens with clang-8.0 and clang build from master, with catch 2.5 and 2.7. You could probably also "fix" it by using function local statics, which has the nice side effect of making it thread safe (since C++11)
|
Description
I ran Clang Static Analyzer over nlohmann/json which uses Catch 2.2.1 in a feature branch. The analyzer reported a warning in Catch's source code:
I attached a ZIP file of the HTML report where the analyzer's trace can be followed: report.zip
This may be a false positive, but I though this about all warnings of Clang Static Analyzer that eventually turned out to be real issues :-)
Steps to reproduce
feature/catch2
branch ofnlohmann/json
make clang_analyze
(possibly adjust the path to Clang Static Analyzer).
Extra information
The text was updated successfully, but these errors were encountered: