[PATCH] D61710: lld: Add a warning limit, similar to the existing error limit

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 20:38:37 PDT 2019


thakis added a comment.

In D61710#1495938 <https://reviews.llvm.org/D61710#1495938>, @ruiu wrote:

> I'm not confident that this is what the user wants. This might be useful, but at the same time I can imagine that people want to see an entire log rather than the first part of it.
>
> Does clang or other tools have a similar feature?


I'm not sure either this is the right approach. So far the only real use case I know of is in lld-link with /force. There are two use cases for it:

- The flag is useful when trying to reduce a bug from a large program to a small program. You can just keep deleting .cc input files and add /force and see if the bug stays around. For example, when reducing the recent /natvis: debug info bug from "build chromium" to PR41626 this was useful.

- Now that lld-link reports duplicate resources as errors and has /force:duplicateres to turn those into a warning so that people can incrementally fix their codebase as they update to the new lld, they might want to disable the warning for that for some target that takes a while to fix.

In both cases, I actually want to see 0 warnings – and this patch doesn't support -warninglimit:0 (or it does, but it means "all warnings", not "no warnings").

With link.exe, I can do /force /ignore:4006 and not get warnigns about duplicate symbols. Maybe we should instead add support for /ignore:4006 . link.exe with /force turns duplicate symbol errors into a warning and can /ignore them, but for undefined symbols it still prints "error:" and then exits with exit code 0 – and there is as far as I can tell no way to disable that diagnostic. So I don't know if we'd want to make /ignore:4006 disable all the /force: warnings if we go that route or what else to do for undefined symbols, and what to do for 'duplicate res' diagnostics (which link.exe can't /force at all, they're always hard errors there).

clang does have very granular warning flags, so this is a bit less of an issue there.

clang does have -w to disable _all_ warnings. I suppose that would be good enough for the /force use case as well – if you use force you're already a bit desperate and so disabling all warnings would be fine. Maybe we should add a flag to disable all warning output instead?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61710/new/

https://reviews.llvm.org/D61710





More information about the llvm-commits mailing list