This is an archive of the discontinued LLVM Phabricator instance.

[lld-link] For suppressible warnings, print the suppressing flag.
ClosedPublic

Authored by thakis on Mar 9 2018, 4:51 AM.

Details

Reviewers
ruiu
hans

Diff Detail

Event Timeline

thakis created this revision.Mar 9 2018, 4:51 AM
hans added inline comments.Mar 9 2018, 4:59 AM
COFF/Driver.cpp
809

Would it be helpful to make warn() take an optional warning number and tweak the message accordingly?

"no /ignore:1234" is a bit terse for my taste. How about "suppress with /ignore:1234" or "pass /ignore:1234 to suppress" or something similar?

thakis added inline comments.Mar 9 2018, 9:55 AM
COFF/Driver.cpp
809

That's too word for me. I had "[/ignore:1245 to ignore]" but didn't like the redundant "ignore". I like the terse message, it's similar to how clang prints warning flags.

Making warn() responsible for this makes sense once we have more than 2 uses. For now, this seems ok to me.

ruiu added inline comments.Mar 9 2018, 10:59 AM
COFF/Driver.cpp
809

"[no /ignore:4217]" is repeated a few times in this patch indeed, but I don't think that is too many to add a new parameter to warn(). I'm fine with what you did in this patch.

thakis added inline comments.Mar 10 2018, 11:24 AM
COFF/Driver.cpp
809

Another idea would be to print [LNK4217] which is even terser and which finds the link.exe docs in search engines, but it's surprisingly difficult to find the /ignore: flag that way. (OTOH, with the /ignore:4217 it's hard to realize that the thing to search the web for is "lnk4217"). I don't have a strong preference between [no /ignore:4217] and [LNK4217], I probably weakly prefer the latter a bit. Hans, since you had an opinion on the spelling, wdyt?

hans accepted this revision.Mar 12 2018, 2:46 AM
hans added inline comments.
COFF/Driver.cpp
809

It's hard to come up with anything terse that's also really clear.

[LNK1234] is really short, and also very compatible so maybe that's the way to go.

This revision is now accepted and ready to land.Mar 12 2018, 2:46 AM
thakis closed this revision.Mar 12 2018, 5:07 AM

r327257, thanks!

Maybe we should also print something like

                                                                             
"use /ignore: to suppress numbered warnings"

if we print at least one warning with a number. Not in this change here, though.