auto functions checker, fix several cases of false warnings#379
auto functions checker, fix several cases of false warnings#379Hackerpilot merged 2 commits intomasterfrom unknown repository
Conversation
|
Note that it would be possible to skip |
Wow that managed to catch a lot of false positives - great job :) There are just eight occurrences of mixin returns in Phobos, so it might be an option to use the slightly more verbose |
|
Thanks, yesterday I was browsing all the files in phobos root directory and I didn't get where the hell dscanner was called. |
I don't know whether this is possible because AFAIK is Dscanner unable to expand mixins and verify that they indeed have a |
Btw in case you need a reduced test case, here's a simple one: assertAnalyzerWarnings(q{
auto doStuff(){ mixin(_genSave());}
private static string _genSave() @safe pure nothrow
{
return `import std.stdio;` ~
`return true`;
}
}, sac); |
prevent a few false warnings:
assert(0): function not designed to be called.assert(false): function not designed to be called.mixin("return" ...): try to find return in the literal.extern(C) strlen(char*);: so obvious, same for@disablemore cases exist but they are not easily detectable.
Related to dlang/phobos#4850 (comment).
@wilzbach, can you check if the cases that led you to disable the check are handled now ?