On Thu, 25 Jul 2024, Martin Storsjö wrote:

A command like "cc -c -E" is tautological; the -c is ignored, when
we explicitly specify that we want to preprocess only.

Since
https://github.com/llvm/llvm-project/commit/6461e537815f7fa68cef06842505353cf5600e9c
and https://github.com/llvm/llvm-project/pull/98607, Clang now
warns about the unused "-c" argument in this case.

We already did omit the "-c" argument when preprocessing
(with cl.exe) for armasm, but do this for other cases as well.
---
gas-preprocessor.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 19b0131..aa3abc0 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -155,6 +155,8 @@ while ($index < $#preprocess_c_cmd) {
    $index++;
}

+@preprocess_c_cmd = grep ! /^-c$/, @preprocess_c_cmd;
+
my $tempfile;
if ($as_type ne "armasm") {
    @gcc_cmd = map { /\.[csS]$/ ? qw(-x assembler -) : $_ } @gcc_cmd;
@@ -163,7 +165,6 @@ if ($as_type ne "armasm") {
    # Clang warns about unused -D parameters when invoked with "-x assembler".
    @gcc_cmd = grep ! /^-D/, @gcc_cmd;
} else {
-    @preprocess_c_cmd = grep ! /^-c$/, @preprocess_c_cmd;
    @preprocess_c_cmd = grep ! /^-m/, @preprocess_c_cmd;

    @preprocess_c_cmd = grep ! /^-G/, @preprocess_c_cmd;
--
2.34.1

Will push this soon.

// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to