Skip to content

Commit 9819d4d

Browse files
committed
Omit the "-c" argument from the preprocessing command
A command like "cc -c -E" is tautological; the -c is ignored, when we explicitly specify that we want to preprocess only. Since llvm/llvm-project@6461e53 and llvm/llvm-project#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.
1 parent be58b46 commit 9819d4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gas-preprocessor.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ ()
155155
$index++;
156156
}
157157

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

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

0 commit comments

Comments
 (0)