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
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
The text was updated successfully, but these errors were encountered:
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
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...
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
The text was updated successfully, but these errors were encountered: