You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to have some sort of annotation we could add to functions to tell the analyzer to treat them as non-returning. I'm seeing the same linter error, SA5011, with a call to an in-house logging package's Fatal() function. As with logrus, the actual behavior depends on a function variable.
Clang-analyzer uses __attribute__((analyzer_noreturn)) to emphasize that the attribute impacts analysis only and not compilation, as opposed to the GCC attribute noreturn.
Would it be possible to detect a comment line like // analyzer_noreturn when it's the last (or only) line of a function's block comment, then mark the function as noreturn?
Ran
staticcheck ./...
against:Staticcheck returned:
This version does not trigger the warning:
The text was updated successfully, but these errors were encountered: