Skip to content
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

Feature request: Integration with clang's __attribute__((analyzer_noreturn)) #380

Open
jonesmz opened this issue Mar 2, 2023 · 0 comments

Comments

@jonesmz
Copy link

jonesmz commented Mar 2, 2023

When running clang-tidy, the analyzer is able to provide much more succinct problem reports when developers can inform the analyzer "if this function is called, stop, that's the bug".

Frequently, boost test based unit tests can give the analyzer fits where it dumps out hundreds or thousands of lines of additional analysis pertaining to the boost test framework, when it should really have stopped at the assertion failing instead of continuing to digest all of the inner machinery from the framework.

To enable this enhanced analysis, it's sufficient to check in the preprocessor

__has_feature(attribute_analyzer_noreturn)

and if that's true, then add

__attribute__((analyzer_noreturn))

to some appropriate function that is only called when a test case fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant