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

The actual error in a report message should be at the diagnostic message, not at the last bug path event #3722

Open
vodorok opened this issue Aug 19, 2022 · 1 comment
Assignees
Labels
GUI 🎨 refactoring 😡 ➡️ 🙂 Refactoring code. usability 👍 Usability-related features

Comments

@vodorok
Copy link
Collaborator

vodorok commented Aug 19, 2022

The diagnostic message should be used when indicating an error, as this report element indicates an error in the code semantically.
Right now the last bug path event is treated as the error because Clang static analyzer emits reports in format where diagnostic message is duplicated in the last position, this is a clangsa quirk and Codechecker should not rely on this behavior. For Cppcheck to work correctly the bug path event list is needed to be extended with the diagnostic message, which is a redundant step, as the diagnostic message also has a location.

The position of an error is critical from the point of report suppression, so the impact of this modification should be carefully examined, but a clearer error presentation would be desirable in the future.

This is a follow up to #3680
Also a follow up to #3721

@vodorok vodorok added GUI 🎨 usability 👍 Usability-related features refactoring 😡 ➡️ 🙂 Refactoring code. labels Aug 19, 2022
@vodorok vodorok added this to the release 6.20.0 milestone Aug 19, 2022
@vodorok vodorok self-assigned this Aug 19, 2022
@vodorok vodorok changed the title The actual error in a report message should be at the diagnostic message, not at the last bug path event. The actual error in a report message should be at the diagnostic message, not at the last bug path event Aug 19, 2022
@whisperity
Copy link
Contributor

Note that the reliance on the invariant for the last element is indeed a CSA-related kludge, because Clang-Tidy has always been emitting diagnostics as [warning, note, ..., warning) ranges: every note (and remark) after a warning belongs to that warning (or error), so it is the top-level warning outputs that demarcate individual reports...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI 🎨 refactoring 😡 ➡️ 🙂 Refactoring code. usability 👍 Usability-related features
Projects
None yet
Development

No branches or pull requests

4 participants