[PATCH] D158688: [Driver,ARM,AArch64] Ignore -mbranch-protection= diagnostics for assembler input

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 29 11:01:00 PDT 2023


MaskRay added a comment.

In D158688#4624267 <https://reviews.llvm.org/D158688#4624267>, @simon_tatham wrote:

> The change LGTM, and "agree with gcc" seems like a reasonable justification in this case.

Thank you both!

> But I'm curious more generally about what options should / shouldn't be covered by `-Wunused-command-line-argument`. Doesn't the same reasoning apply to //most// options that C compilation uses and assembly doesn't? If you have a command of the form `clang -someoption -c foo.c`, it's surely //always// convenient for a user to be able to change the `.c` into a `.s`, or to put a variable list of files on the end of the command line which might or might not include any `.c` files.

`-Wunused-command-line-argument` does fire for most options when the only input kind is assembly without preprocessing.
It seems that the diagnostics are for `assembler` input, not `assembler-with-cpp`...

> Why is this option in particular different from others? Is there a documented policy anywhere?

I am not aware of a documented policy anywhere, but I have some notes on https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument#assembler-input .

Let me ask on Discourse: https://discourse.llvm.org/t/wunused-command-line-argument-for-assembly-files/73111


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158688



More information about the cfe-commits mailing list