Fixes PR36657.
Diff Detail
Event Timeline
COFF/Driver.cpp | ||
---|---|---|
809 | Higher-level question: link.exe prints the warning number here, so the user can figure out what /ignore option to pass. Is there some way we can let an lld-link.exe user figure out how to ignore this warning? |
COFF/Driver.cpp | ||
---|---|---|
809 | This is imho an excellent question, and I wondered about this myself. /ignore:4217 (already implemented) has the same problem – so since this is consistent with that warning, I figured I don't need to figure this out right now. lld-link's warning configurability is generally nonexistent, making this even less obvious. Maybe we should add "[/ignore:N to ignore]" to the end of the warning text for warnings that have a disable flag? That seems like a good approach to me – Rui, what do you think? But that should be a separate patch. |
COFF/Driver.cpp | ||
---|---|---|
809 | Yes, absolutely this should be handled separately, just wanted to raise the question. Your patch looks good to me |
Side note - I raised the /ignore issue here: https://bugs.llvm.org/show_bug.cgi?id=36445
In the future I think this should be fixed once for all by tagging the messages with the corresponding Microsoft LNK number.
In that case, warn("/order...") could become lnkWarn(4217, "/order...") and automatically handle /ignore.
In the future I think this should be fixed once for all by tagging the messages with the corresponding Microsoft LNK number.
In that case, warn("/order...") could become lnkWarn(4217, "/order...") and automatically handle /ignore.
Adding a helper function that takes an error number might make sense, but I think that the use of the function is fairly limited, because lld doesn't try to do the exact same thing as MSVC link.exe. We sometimes emit a warning on which MSVC would emit a warning, but that's not too many.
Higher-level question: link.exe prints the warning number here, so the user can figure out what /ignore option to pass. Is there some way we can let an lld-link.exe user figure out how to ignore this warning?