This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] warnings-as-error no longer exits with ErrorCount
ClosedPublic

Authored by njames93 on Jun 16 2020, 10:57 AM.

Details

Summary

When using -warnings-as-errors, If there are any warnings promoted to errors, clang-tidy exits with the number of warnings. This really isn't needed and can cause issues when the number of warnings doesn't fit into 8 bits as POSIX terminals aren't designed to handle more than that.
This addresses https://bugs.llvm.org/show_bug.cgi?id=46305.

Bug originally added in D15528

Diff Detail

Event Timeline

njames93 created this revision.Jun 16 2020, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2020, 10:57 AM
aaron.ballman accepted this revision.Jun 16 2020, 11:39 AM

LGTM unless @jroelofs has a reason why the code was originally written that way, but can you add test coverage for it?

This revision is now accepted and ready to land.Jun 16 2020, 11:39 AM

LGTM unless @jroelofs has a reason why the code was originally written that way, but can you add test coverage for it?

How would you suggest I add test coverage for this, afaik llvm-lit doesn't seem to handle checking specific exit codes, only whether is was 0 or not.
There are already test cases for a non-zero exit code with -warnings-as-errors.

LGTM unless @jroelofs has a reason why the code was originally written that way, but can you add test coverage for it?

How would you suggest I add test coverage for this, afaik llvm-lit doesn't seem to handle checking specific exit codes, only whether is was 0 or not.
There are already test cases for a non-zero exit code with -warnings-as-errors.

If lit doesn't provide a way to do this, I don't insist. I was thinking you'd have a way to use the lit shell to compare against the return value since it had the ability to test against nonzero or not.

This revision was automatically updated to reflect the committed changes.