Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [GASPP PATCH] Omit the "-c" argument from the preprocessing command
@ 2024-07-25  8:25 Martin Storsjö
  2024-07-29 13:15 ` Martin Storsjö
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Storsjö @ 2024-07-25  8:25 UTC (permalink / raw)
  To: ffmpeg-devel

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

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [GASPP PATCH] Omit the "-c" argument from the preprocessing command
  2024-07-25  8:25 [FFmpeg-devel] [GASPP PATCH] Omit the "-c" argument from the preprocessing command Martin Storsjö
@ 2024-07-29 13:15 ` Martin Storsjö
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Storsjö @ 2024-07-29 13:15 UTC (permalink / raw)
  To: ffmpeg-devel

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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-29 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-25  8:25 [FFmpeg-devel] [GASPP PATCH] Omit the "-c" argument from the preprocessing command Martin Storsjö
2024-07-29 13:15 ` Martin Storsjö

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git