[PATCH] D121560: [clang][Opt] Add NoArgUnusedWith to not warn for unused redundant options

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 09:38:33 PDT 2022


abrachet added a comment.

In D121560#3439570 <https://reviews.llvm.org/D121560#3439570>, @MaskRay wrote:

> If you need a -static-libstdc++ not subject to unused argument warning, --start-no-unused-arguments and D53238 <https://reviews.llvm.org/D53238> (-static=c++stdlib) may be better choices.

That patch might help for `-static-libstdc++` in particular and other -static-* flags, however there are other flags that this will help with in the future. What about `-nostdlib -noprofilelib`. I'm currently only interested with `-nostdlib` and haven't looked into other flags but I suspect this could help in other instances too. Could be helpful with sanitizers too, but all their flags get read into SanitizerArgs so there are never warnings there.

I don't think --start-no-unused arguments is as good as a solution here. For a large project build, I think `--{start,end}-no-unused-arguments` is too heavy a hand. You would just end up putting it everywhere and lose any warnings that might be useful. This patch is specifically trying to reduce the need for those.


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

https://reviews.llvm.org/D121560



More information about the llvm-commits mailing list