[all-commits] [llvm/llvm-project] cbf495: [Clang][Driver] report unsupported option error wh...
Reno Dakota via All-commits
all-commits at lists.llvm.org
Fri Nov 29 12:16:25 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cbf495fd12ba08c3a8e10dbcd482df1bf80736ed
https://github.com/llvm/llvm-project/commit/cbf495fd12ba08c3a8e10dbcd482df1bf80736ed
Author: Reno Dakota <paparodeo at proton.me>
Date: 2024-11-29 (Fri, 29 Nov 2024)
Changed paths:
M clang/lib/Driver/Driver.cpp
M clang/test/Driver/unsupported-option.c
Log Message:
-----------
[Clang][Driver] report unsupported option error when link + compile in same process (#116476)
Fixes: https://github.com/llvm/llvm-project/issues/116278
This change updates clang to report unsupported option errors regardless
of the command line argument order.
When clang is invoked with a source file and without `-c` it will both
compile and link. When an unsupported option is also part of the command
line clang should generated an error. However, if the source file name
comes before an object file, eg: `-lc`, the error is ignored.
```
$ clang --target=x86_64 -lc hello.c -mhtm
clang: error: unsupported option '-mhtm' for target 'x86_64'
$ echo $?
1
```
but if `-lc` comes after `hello.c` the error is dropped
```
$ clang --target=x86_64 hello.c -mhtm -lc
$ echo $?
0
```
after this change clang will report the error regardless of the command
line argument order.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list