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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to